Tuesday, 22 October 2013

WebSphere Application Server JVMs - Dumping

Thanks to my mate, Mike, for this.

<caveat emptor>

Want to force a WAS JVM ( or, almost certainly, any other JVM ) to generate a core dump ( Javacore ) ?

Using Unix ?

If so, identify the Process ID ( PID ) of the JVM, perhaps using ps auxw | grep -i java and then, once you've checked AND double-checked that it's the right PID, issue this command: -

$ kill -3 12345

( where 12345 is an example of the PID )

The Javacore will be, by default, written to the WAS profile root e.g. /opt/IBM/WebSphere/AppServer/profiles/AppSrv01.

Want to force a heap dump ?

If so, fire up wsadmin: -

$ cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin
$ ./wsadmin.sh -lang jacl

wsadmin> set objectName [$AdminControl queryNames WebSphere:type=JVM,process=<JVM Name>,node=<Node Name>,*] 

which returns something like this: -

wsadmin> $AdminControl invoke $objectName generateHeapDump

Again, the heap dump  will be, by default, written to the WAS profile root e.g. /opt/IBM/WebSphere/AppServer/profiles/AppSrv01

</caveat emptor>

Remember - your mileage may vary - if in doubt, do nowt


Michael Prendergast said...

there's a good practice here to explicitly define the directory that dumps are written to. Mainly because that will allow you tostop them filling up the whole filesystem, and killing everything instead of just one jvm.

you can specify the javacore via IBM_JAVACOREDIR in the jvm props.
theere's also an equivalent for heap and native core dumps see

Michael Prendergast said...

or http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/topic/com.ibm.java.doc.diagnostics.50/diag/appendixes/env_var/env_jvm.html

if you don't want to change the scripts

Dave Hay said...

Cheers, Mike, much obliged :-)