Skip to content

Instantly share code, notes, and snippets.

@balcsida
Last active August 25, 2020 08:57
Show Gist options
  • Save balcsida/dddb41acdaaecf482a2782418416420d to your computer and use it in GitHub Desktop.
Save balcsida/dddb41acdaaecf482a2782418416420d to your computer and use it in GitHub Desktop.
Obtain heapdump through a shell where jmap is not available
#!/usr/bin/env bash
shopt -s dotglob
curl -LO https://github.com/apangin/jattach/releases/download/v1.5/jattach
echo 'adab16e1081aa4fafc91f3f2e44262338a498d8f853d3c6801050889e6389548 jattach' | sha256sum --check --status
chmod +x jattach
./jattach $(pidof java) dumpheap /opt/liferay/data/LiferaySupport/$(hostname)/$(date +%Y_%m_%d-%H_%M).hprof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment