Hemant Vyas
Hemant Vyas

Reputation: 76

Java Heap dump location , unix command line

I am facing a issue in which my heapdump is more than 2gb or maybe even 3gb is some cases , Now the problem is the heap dump gets created in a location (/home) which is of around 1gb only so after 1gb of heapdump the server gets deadlock(No other process can run) I just want to change the location of the Heapdump.

I am running my code on unix server , and increasing the size of /home dir is not an option. I have tried using -XX:HeapDumpPath but it is not working. Please help me out here.

Upvotes: 0

Views: 8624

Answers (2)

Hemant Vyas
Hemant Vyas

Reputation: 76

JAVA_OPTS="$JAVA_OPTS -Xdump:heap:label=/dumps/heapdump.%Y%m%d.%H%M%S.%pid.%seq.phd" 
JAVA_OPTS="$JAVA_OPTS -Xdump:java:label=/dumps/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt" 
JAVA_OPTS="$JAVA_OPTS -Xdump:system:label=/dumps/core.%Y%m%d.%H%M%S.%pid.%seq.dmp" 
JAVA_OPTS="$JAVA_OPTS -Xdump:snap:label=/dumps/Snap.%Y%m%d.%H%M%S.%pid.%seq.trc" 
(Optional) JAVA_OPTS="$JAVA_OPTS -Xdump:what" 

You can change the JAVA_OPTS env variable or simple add individual -Xdump cmds from where you are running the code. like java -d64 -Xdump:heap:label=/${INFA_ROOT}/temp/heapdump.%Y%m%d.%H%M%S.%pid.%seq.phd -Xmx4g ...rest of the arrgs.

Upvotes: 0

shurick
shurick

Reputation: 39

You should use -XX:HeapDumpPath='your location' according to http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#DebuggingOptions

Upvotes: 0

Related Questions