8

not getting java heap dump on outofmemoryerror: Tried this (one.exe is my java rcp app):

one.exe -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\Temp

but didn't help, the folder path is accessible. I even tried giving name like heap.hprof, but with no result. Can someone guide me here ?

user1782807
  • 151
  • 3
  • 13

2 Answers2

2

Some thrown heap overflows are not real overflows, but are thrown directly after calculation. In fact, there is no overflow. such as DirectByteBuffer(use allocateMemory)

-2

-XX:+HeapDumpOnOutOfMemoryError Command-line Option If you specify the -XX:+HeapDumpOnOutOfMemoryError command-line option, and if an OutOfMemoryError is thrown, the VM generates a heap dump

This above argument says it will generate HeapDump when OOM is thrown. If the JVM argument is passed to JVM and no heap dump got generated then it implies the application yet to suffer OutOfMemory condition.If you need confirmation then take native stderr log file of the application to check did application suffers any OOM? or include -verbose:gc jvm argument and collect verbose logs and check the last cycle of the GC to check the free bytes of the java heap.

Mohan Raj
  • 1,104
  • 9
  • 17