Open adamsitnik opened 5 years ago
How much volume do you expect to get from this? Right now, I feel like this is useful is specific cases, but not necessarily in the general case. If I think about leak analysis, this would show up in allocation tick events and we'd be able to tell that the allocator is the ArrayPool (and then head down that path of investigation). Are there more general cases where this shows us information that we wouldn't otherwise have?
How much volume do you expect to get from this?
It depends on the usage of ArrayPool but I don't think that volume would be big.
Perhaps a middle ground solution would be to enable only the BufferAllocated (Level=Informational) events by default? It would show up in applications that use ArrayPool in the wrong way (a dev wanted to pool memory but is allocating it every time instead).
ArrayPool
has it's own EventSource It emits 3 events:BufferRented
BufferReturned
(the count should be equal to the count ofBufferRented
events)BufferAllocated
which means that the there was a request for an array bigger than the pool size and the buffer got allocated instead of rented from the pool.When using PerfView I very often add it manually to the list of Additional Providers to make sure that ArrayPool is used correctly.
My proposal: add
System.Buffers.ArrayPoolEventSource
to the list of default .NET Providers.@billwert @brianrob If you are OK with that I would like to send a PR with the required change.