Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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