Skip to content

Instantly share code, notes, and snippets.

@yhemanth
Created March 27, 2013 05:03
Show Gist options
  • Save yhemanth/5251786 to your computer and use it in GitHub Desktop.
Save yhemanth/5251786 to your computer and use it in GitHub Desktop.
Script and options that should be used to copy a memory dump from a node on Hadoop Cluster to HDFS on OutOfMemory in MR task - Thanks to Koji Noguchi (http://goo.gl/jWR4x)
#!/bin/sh
hadoop fs -put heapdump.hprof /tmp/heapdump_hemanty/${PWD//\//_}.hprof
conf.set("mapred.create.symlink", "yes");
conf.set("mapred.cache.files", "hdfs:///user/hemanty/scripts/copy_dump.sh#copy_dump.sh");
conf.set("mapred.child.java.opts",
"-Xmx200m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heapdump.hprof -XX:OnOutOfMemoryError=./copy_dump.sh");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment