Skip to content

Instantly share code, notes, and snippets.

@atrakic
Last active December 12, 2018 13:21
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 atrakic/f9bc966391e67dbe1fbdfb3009bd38ce to your computer and use it in GitHub Desktop.
Save atrakic/f9bc966391e67dbe1fbdfb3009bd38ce to your computer and use it in GitHub Desktop.
#!/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