cancel
Showing results for 
Search instead for 
Did you mean: 

Can't find Java Heap Dump hprof file

Former Member
0 Kudos

Hi,

I am encountering Out Of Memory crashes on my EP J2EE and want to use the SAP Java Memory Analyzer tool to have a look at the Java Heap Dump.

If found a couple of blogs and wikis about how to get a Heap DumP

1. In SAPMMC right-click on the JEE Server process and select Dump Stack Trace

2. JVM parameter -XX:+HeapDumpOnOutOfMemoryError

The dump file should then be generated as

filename:

java_pid<pid>.hprof.<unique number>

folder:

/usr/sap/<system>/JC<instance>/j2ee/cluster/server<node>/

or /usr/sap/<system>/JC<instance>/j2ee/work

I tried a lot but could not finde a hprof file anywhere.

Free disk space on server drive is 166 GB (drive D:). JVM binaries are located on C: where 5 GB are free.

JVM is Sun j2sdk1.4.2_12

Does anyone have a hint where the dump file is written?

Can this be configured?

Best regards

Ingo

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

as Krum already wrote, for the SAP MMC to give you a heap dump you have to set the -XX:+HeapDumpOnCtrlBreak parameter.

If you are not getting your dumps (which should be written into the working directory of the process), please do as Krum wrote and check whether your parameters are active or if you just can't find them, please look for an hprof file with a find tool or the Windows search if it is Windows that you run on.

Please have a look on slide 14 in our JavaOne presentation here: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00ca7f0d-8ee6-2910-5d82-fc3e8dd2.... There we have put together as a reference how to configure the JVM correctly for a SAP application server installation.

Hope this helps,

Kind regards,

Vedran

Answers (1)

Answers (1)

krumts
Advisor
Advisor
0 Kudos

Hi Ingo,

Which way to get a heap dump have you tried - through MMC or on OutOfMemory? Or May be both?

To get the heap dump through the MMC one has to set in advance the java option:

-XX:+HeapDumpOnCtrlBreak

Can you look into /usr/sap/<system>/JC<instance>/j2ee/work/dev_server<N> if the parameters are really specified?

Regards,

Krum

kohlerm
Employee
Employee
0 Kudos

Hi Ingo,

Just saw your post. As Krum said you need -XX:+HeapDumpOnCtrlBreak if you want to trigger the heap dump on a 1.4 JDK.

After you added this option and you trigger the Dump in the MMC you should alos get a message in dev_server* that a heap dump was triggered.

If your server really is running out of memory and the VM doesn't crash completely and the VM just exits becaus of en OOM (should be reported in the log files), then you should also a get a heap dump in your server directory.

Sometimes the VM completely crashes and no heap dump is written, you can check this by looking for files hs_err* files.

Regards,

Markus

Former Member
0 Kudos

Thanks for your answer.

I tried both ways to get the dump.

Below you can see the parameters for the VM.

I copied this from the config tool

Cluster Data > Instance XY > Server XY

Section General / Java Settings

So both parameters seem to be there...

Regards

Ingo

-Djava.security.policy=./java.policy

-Djava.security.egd=file:/dev/urandom

-Dorg.omg.CORBA.ORBClass=com.sap.engine.system.ORBProxy

-Dorg.omg.CORBA.ORBSingletonClass=com.sap.engine.system.ORBSingletonProxy

-Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sap.engine.system.PortableRemoteObjectProxy

-Djco.jarm=1

-XX:MaxPermSize=256M

-XX:PermSize=256M

-Xms1024M

-XX:NewSize=171M

-XX:MaxNewSize=171M

-XX:+DisableExplicitGC

-verbose:gc

-Xloggc:GC.log

-XX:+PrintGCDetails

-XX:+PrintGCTimeStamps

-XX:+PrintTenuringDistribution

-Djava.awt.headless=true

-Dsun.io.useCanonCaches=false

-XX:SoftRefLRUPolicyMSPerMB=1

-XX:SurvivorRatio=2

-XX:TargetSurvivorRatio=90

-Dorg.omg.PortableInterceptor.ORBInitializerClass.com.sap.engine.services.ts.jts.ots.PortableInterceptor.JTSInitializer

-XX:+UseParNewGC

-Xmx1024M

-Djavax.security.auth.useSubjectCredsOnly=false

-Djava.security.krb5.conf=D:\WMEP6\krb5\krb5.conf

-Dsun.security.krb5.debug=true

-XX:+UseTLAB

-XX:+HeapDumpOnOutOfMemoryError

-XX:+HeapDumpOnCtrlBreak

Former Member
0 Kudos

Hi Markus,

thanks for that hint.

It's true I can see this entry in the log when I request a dump in the MMC:

==========================================

dump stack trace : Fri Aug 31 12:29:03 2007

==========================================

Full thread dump Java HotSpot(TM) Server VM (1.4.2_12-b03 mixed mode):

And even these from the OutOfMemory events:

FATAL: Caught OutOfMemoryError! Node will exit with exit code 666

==============================================

getThreadDump : Wed Aug 29 16:05:44 2007

FATAL: Caught OutOfMemoryError! Node will exit with exit code 666

==============================================

java.lang.OutOfMemoryError

Full thread dump Java HotSpot(TM) Server VM (1.4.2_12-b03 mixed mode):

But - hm - there is no new file in

D:\usr\sap\EN6\JC20\j2ee\cluster\server0

Regards

Ingo

Former Member
0 Kudos

Thanks all for help.

I found the issue myself:

I just set the VM parameters at the server in config tool.

After placing them at the instance it works well.

Regards

Ingo

Former Member
0 Kudos

Hi Ingo,

I am also facing the same problem, I did set those two parameters at instance server General tab, the problem sill there, what exactly you did for fixing the issue for generating Heap Dump hprof file.

Thanks

Anil

Former Member
0 Kudos

In the config tool there are several nodes:

+ Instance_IDxyz

-- dispatcher_IDxy

-- server_IDxy

After I put the -XX:+HeapDumpOnOutOfMemoryError

parameter on the instance, node Tab "Servers General", field "Java parameters" it worked for me.

Regards

Ingo

Former Member
0 Kudos

Hi Ingo,

Thanks for you reply, the problem is -XX:+HeapDumpOnOutOfMemoryError is not Valid VM parameter.

I solved the problem, by installing latest JDK1.4.2_15 update from sun.

Regards,

Anil