I have a program that should eventually generate OutOfMemory
.
The program code is:
public class VeryLargeObject implements Serializable {
p
For starter drop the XX options and any options BEFORE VeryLargeObject
, otherwise you pass the parameters to the java program and not the JVM
The problem is that -XX:HeapDumpPath
spefies a file and not a path.
-Xms1024m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="c:\temp\dump2.hprof"
added:
and bestsss is right too, so you need to fix both "errors":
java -Xms1024m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="c:\temp\dump2.hprof" VeryLargeObject
I suspect the jvm could not write to the path and fails silently. For example, this has to be a file name in a directory which exists. If you have a directory D:\workspace
it will fail. If you have D:\workspace\heap.hprof
it may work. Try creating a blank file of that name first to see you can do this.