google / tcmalloc

Apache License 2.0
4.31k stars 463 forks source link

Help with heap profiler. #226

Closed srip86 closed 2 months ago

srip86 commented 5 months ago

Hi, Using tcmalloc heap profiler for the first time followed instructions from here https://gperftools.github.io/gperftools/heapprofile.html

Linked library and tried to turn on heap profiler with below command

HEAP_PROFILE_TIME_INTERVAL=10 HEAPPROFILE=/tmp/memdump.hprof /usr/lib/myprocess

My intention was try to dump heap profile every 10 seconds, However it just exits after dumping twice even though the process is running.

Starting tracking the heap Dumping heap profile to /tmp/memdump.hprof.0001.heap (1710536152 sec since the last dump) Dumping heap profile to /tmp/memdump.hprof.0002.heap (Exiting, 3 MB in use)

Why does it stop after dumping twice even when process is still running ? Is this the right way to start/use heap profiler? Appreciate any inputs.

ckennelly commented 2 months ago

Since this is for https://github.com/gperftools/gperftools, raising the issue there might get the right eyes on it.