parca-agent icon indicating copy to clipboard operation
parca-agent copied to clipboard

Allocation Profiling Support

Open brancz opened this issue 4 years ago • 2 comments

Aside from CPU profiling, allocation profiling is very useful as well, especially because a lot of CPU is spent on poor allocation practices. Allocation profiling can also be useful for troubleshooting memory leaks.

This can be done using USDT (Userland Statically Defined Tracing) using uprobe. It's likely that this will require language/runtime specific implementations (see bcc's uobjnew).

brancz avatar Jul 09 '21 15:07 brancz

That's neat. How far do you want to take this? Some part of this screams plain prometheus "exporter" for USDT or any uprobe. But the combination of counter + backtrace for anything (sent UDP packets, bytes, number of CPU migrations, ...) is really interesting.

zecke avatar Oct 26 '21 15:10 zecke

I think I'd like to see us building full profiles with the stack traces that call the allocation causing functions. I think it would be neat to build two separate profiles

  1. the number of allocations
  2. the amount of memory allocated

The differentiation can be interesting because often CPU can be improved not by allocating less memory in total, but just more contiguous memory at once.

brancz avatar Oct 29 '21 14:10 brancz