Last active
December 12, 2018 13:21
-
-
Save atrakic/f9bc966391e67dbe1fbdfb3009bd38ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install RPM package (due to its size intentinally omited from Dockerfile): | |
yum install -y java-1.8.0-openjdk-devel.x86_64 | |
# get id in which java process we are interested: | |
JPID=$(jps -l|grep query | awk '{print $1}') | |
# prepare for filegen: | |
FILE=dump-$(date +"%s").hprof | |
# you need to be here since directory is accesseble on docker (ECS) host | |
cd /data | |
# generate heap dump (kill -3 $JPID doesnt work!) | |
jmap -dump:format=b,file=$FILE $JPID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment