Question

I am using java "1.6.0_24" OpenJDK. Sometimes when I run my program, all that I get is a message

Could not create the Java virtual machine.".

Some other times, the program runs perfectly fine.

Is there some set of options that I can add to get more verbose output as to the exact error (maybe even something similar to a core dump?).

This is probably not related to the heap size since in that case, it does give a definite and clear error message like :-

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

This I could fix with setting -Xms and -Xmx appropriately. However, the JVM quitting without printing anything else at all is very unhelpful.

Just to clarify, my question is about coaxing more verbose error messages or some sort of status files / core dumps which I can then use for debugging.

Was it helpful?

Solution

Start with a small heap. Set -Xms far lower than -Xmx. Increase the maximum heap size, -Xmx to some 1024(or 2048 depending on your application). Set -Xms to some 512 (I'd say half of Xmx)

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top