Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

This question already has an answer here:

I'd like to have a better understanding of what optimizations HotSpot might generate for my Java code at run time.

Is there a way to see the optimized code that HotSpot is using after it's been running for a while?

share|improve this question

marked as duplicate by assylias, PaRiMaL RaJ, dunni, chollida, bmargulies Jun 2 '13 at 12:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

You would need to use a debug build of the JVM. Then you can use some additional JVM parameters (such as -XX:+LogCompilation and -XX:+PrintOptoAssembly) which make the JVM to print out its optimizations.

share|improve this answer
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.8.21.1791\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Stack Overflow works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </nos"], "copyright__copyright__copyright": ["ove this question\n\nmarked as duplicate by assylias, PaRiMaL RaJ, dunni, chollida, bmargulies Jun 2 '13 at 12:54\n\nThis question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.\n\n2 Answers 2\n\nYou would need to use a debug build of the JVM. Then you can use some additional JVM parameters (such as -XX:+LogCompilation and -XX:+PrintOptoAssembly) which make the JVM to print out its optimizations.\n\nshare|improve this answer"]}