-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi,
Recently we have noticed a lot of LOH allocations since migrating our platform serializer to protobuf and after spending a bit of time on it we have managed to narrow down the problem to the BufferPool.cs.
We used dotMemory and dotTrace to help us identifier the source of the issue; dotTrace points to the method ResizeAndFlushLeft:-
It looks like we have certain responses that require a buffer larger than 65,536 bytes and when it goes into ResizeAndFlushLeft it gets doubled to 131,072 which is automatically allocated on the LOH as it is greater than 85,000 bytes.
We don't think the size of the buffer is a problem per-se it is the fact that they aren't being re-used. This causes repeated allocations on the LOH and causes a high frequency of fragmentation.
We managed to replicate the problem in a test harness.
We would appreciate any guidance on this issue.
Cheers,
Indy
