cancel
Showing results for 
Search instead for 
Did you mean: 

Not a valid HPROF file: heap dump segment has a size of 0.

Former Member
0 Kudos

Hi,

I have a memory dump produced on customer's server using -XX:+HeapDumpOnOutOfMemoryError and when I try to analyze it on my machine I get the error below.

Not a valid HPROF file: heap dump segment has a size of 0.

Not a valid HPROF file: heap dump segment has a size of 0.

Dump was produced on a Windows Server using JDK 1.5.0_14. Same JDK on my developer machine (Windows XP Pro) .

Thanks,

Dan

Edited by: Dan Dragut on Jan 31, 2008 2:36 PM

Edited by: Dan Dragut on Jan 31, 2008 2:37 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member197208
Participant
0 Kudos

Hi Dan,

can you post the result of java -version to the forum?

Can you also, post the log entries of that time? You find them View -> Error Log.

Also pls check the file size of the HPROF file. Does it fit to the expected size, i.e. the memory you have given the VM?

I have looked into the code where the exception is thrown. Each segment of the HPROF file states its length. In this case it is 0. We had cases in the past, where the VM did not write the content properly and it existed only out of zeros. Opening the file with a binary editor revealed the crap content.

Kind regards,

- Andreas.

Former Member
0 Kudos

Hi Andrew,

Thanks for prompt reply.

-


java version "1.5.0_14"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)

Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)

-


com.sap.tools.memory.snapshot.SnapshotException: Not a valid HPROF file: heap dump segment has a size of 0.

at com.sap.tools.memory.internal.snapshot.hprof.Pass1Parser.read(Pass1Parser.java:121)

at com.sap.tools.memory.internal.snapshot.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:189)

at com.sap.tools.memory.internal.snapshot.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:98)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sap.tools.memory.snapshot.SnapshotFactory.invokeMethod(SnapshotFactory.java:163)

at com.sap.tools.memory.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:62)

at com.sap.tools.memory.ui.core.internal.ParseHeapDumpJob.run(ParseHeapDumpJob.java:40)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

-


Since you mentioned, I do notice the file is onl 250 MB where the JVM was configured to use 512 MB, I don't know if it's an issue. I did open the .hprof file, it starts with JAVA PROFILE 1.0.1 and it has readable entries, like class names, packages etc.

Thanks,

Dan

former_member197208
Participant
0 Kudos

Hi Dan,

if content is available, it could also be a bug (those things happen There is not much I could do in remote diagnostics, though. If you want, I can debug the analyzer with your particular heap dump. If you zip the dump, it should be reasonable small. I can provide upload space. Contact me at andreas dot buchen at sap dot com if you are interested. Please keep in mind, that the dump (if written correctly) contains all field variables and therefore may contain sensitive data.

Regards,

- Andreas.

Former Member
0 Kudos

Hi Andreas,

I tried to replicate the OutOfMemory error today and I couldn't. What I found though is that we're using a wrapper application to run our Java application as a Windows Service. I just noticed in one of the logger statements saying that the JVM appears hung, terminating. I believe this may explain why the .hprof file may be incomplete, the JVM could have been terminated in the middle of writing the .hprof file.

Thanks very much for you help, I think I'm ok at the moment - even if we transfer the file (56 MB zipped), if it's incomplete won't help me too much.

Thanks,

Dan

Edited by: Dan Dragut on Jan 31, 2008 9:15 PM

Edited by: Dan Dragut on Jan 31, 2008 9:15 PM

Edited by: Dan Dragut on Jan 31, 2008 9:16 PM

former_member197208
Participant
0 Kudos

Hi Dan,

you don't necessarily have to wait for the OoM. You can also trigger the heap dump on demand and take a look. It might be harder to spot the needle as it didn't grow so much yet, but maybe you already see an anomaly in the haystack.

- Andreas.

Former Member
0 Kudos

Hi Andreas,

I managed to get a full .hprof file and I'm looking into it with your Memory Analyzer tool (watching the screencast tutorial right now, very useful I must say :-).

Thanks for your help and have a good weekend!

Dan

Answers (0)