-
Notifications
You must be signed in to change notification settings - Fork 3
Grabbing a heap dump
Amber Yust edited this page Aug 14, 2017
·
3 revisions
Note: grabbing a heap dump generally requires additional free memory equal to the size of the heap, so memory usage will temporarily double while the heap is being dumped. (Also, the size of the resulting heap dump file will be roughly comparable to the size of the heap, so be prepared for a potentially large download, and try to avoid keeping a ton of dumps around on pepperoni.)
- Find the PID of the process (note that there are generally two
node
processes running, one ofroster
androster-staging
; I typically usehtop
to find the one that's actively using the CPU when I make requests). -
sudo kill -USR2 <pid>
will trigger a heap dump to be written to the/app
directory of the container. -
sudo dokku enter roster
(orroster-staging
as appropriate). - Note: it can take up to 10-15 seconds for the dump to finish writing after the signal is sent; check that the file size of the dump has stopped growing before proceeding to step 5.
-
mv heapdump-* ../roster/storage/
(or../roster-staging/storage/
) to move the heapdump file to where it's more easily accessible outside the container. -
exit
the container shell. - Grab the heapdump file from
/var/lib/dokku/data/storage/roster/
and use as desired.