Anony-Mousse Anony-Mousse - 5 months ago 24
Java Question

Java 7 and -XX:TraceDeoptimization

I'm trying to debug Java deoptimization, but I can't get

-XX:+TraceDeoptimization
to work. Do you know if it was disabled in OpenJDK 7, or maybe is not enabled in my version (7u9-2.3.4-0ubuntu1.12.04.1), or if there is some magic
-XX:+unlockSomething
that I need to call?

No matter what I try, I always get the error message

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


without any further details when I add this parameter. Even a plain
java -XX:+TraceDeoptimization
prints this message. It doesn't say it does not recognize the option, either. However, as
PrintCompilation
reveals, I'm seeing a "made not entrant" messages, which apparently indicate a deoptimization, and I'd like to debug why this is happening, as I'm seeing an odd performance drop with supposedly improved code.

Solution:



The default builds indeed do not include this functionality. You need a debug build. You can find some with Google on jdk7.java.net.

Answer

All flag options require a + or - to enable or disable them. In your case the option would be -XX:+TraceDeoptimization To turn it off (which is the default) you can write -XX:-TraceDeoptimization

Comments