Skip to content

Instantly share code, notes, and snippets.

@julioarguello
Created January 5, 2024 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julioarguello/9cb2656a665ac40b2538c68a61d3c4ca to your computer and use it in GitHub Desktop.
Save julioarguello/9cb2656a665ac40b2538c68a61d3c4ca to your computer and use it in GitHub Desktop.
[Heap dump using groovy] Take a heap dump from Groovy console #sapcommerce #performance
"tail /opt/hybris/data/hybristomcat.java.pid".execute().text
"jmap -dump:format=b,file=/NFS_DATA/transfer/incoming/export/20181014-heapdump.bin 91724".execute().text
"tar -zcvf /NFS_DATA/transfer/incoming/export/20181014-heapdump.bin.tgz /NFS_DATA/transfer/incoming/export/20181014-heapdump.bin.hprof".execute().text
"chmod 777 /NFS_DATA/transfer/incoming/export/20181014-heapdump.bin.addons".execute().text
"chmod 777 /NFS_DATA/transfer/incoming/export/20181014-heapdump.bin.tgz".execute().text
@julioarguello
Copy link
Author

There are 3 steps:

  1. Identify PID
  2. Create heap dump
  3. Compress
  4. Grant permissions for download

@julioarguello
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment