The PrintCompilation flag and how to read its output
Rajiv Shivane has an excellent document on his site titled "Of Thread dumps and stack traces ...". After reading his document, I ventured into some of his other writings and found the following quote here:
"The only flag I could relate to here was the -XX:+PrintCompilation. It is another thing that I have no clue how to interpret the output of this flag either! I vaguely remember reading about this in some javaOne presentation. The presenter had mentioned that it prints the methods which could not be compiled and the user can list the methods which he doesn't want to be compiled in a .hotspot_compiler file. I really wish Sun had documented these flags and their output better, instead of just mentioning "traces methods as compiled" in the VM Options document." [Rajiv Shivane - Of perf degradation with try-finallies and poor VM option docs]
Rajiv, [insert presidential voice] I feel your pain. I really do. I'm working on a document right now which will list out many JVM options and which versions (1.2.2, 1.3.1, etc.) these options are applicable to or not.
But nevertheless, lets get back to the meat of the matter, the question on -XX:+PrintCompilation. I thought that a more detailed explanation of this flags output existed somewhere on the public internet, but maybe I just can't find it today. So I'll make a small attempt to explain the output.
The -XX:+PrintCompilation flag output looks something like this:
|1 ||sb||java.lang.ClassLoader::loadClassInternal ||(6 bytes)
|2 ||b||java.lang.String::lastIndexOf ||(12 bytes)|
|3 ||s!b||java.lang.ClassLoader::loadClass ||(58 bytes)
Flags correspond to:
|b ||Blocking compiler (always set for client)|
|* ||Generating a native wrapper|
|% ||On stack replacement|
|! ||Method has exception handlers|
As Rajiv points on, once you find the offending method, you can tell the JVM to bypass it by creating a .hotspot_compiler file in your current working directory with an exclude statement. For example,
exclude java/lang/String indexOf
This would stop the java.lang.String.indexOf() method from being compiled.
|| © Copyright
6/20/2004; 4:53:33 PM.