Re:JDK7 to have escape analysis on by default...also back po...
by nuclear_eclipse on Wednesday October 07, 2009 @09:22AM
(#866636)
So, what exactly is escape analysis? Neither the article nor the comments here even touch on it.
[ Parent
| on HN ]
Re:JDK7 to have escape analysis on by default...also back po...
by idlewords on Wednesday October 07, 2009 @09:30AM
(#866654)
http://en.wikipedia.org/wiki/Escape_analysis
In a nutshell, figuring out whether a variable or object is going to be entirely confined to a single thread and scope and using that information to perform optimizations (like sticking things into registers) or avoid unnecessary locking.
Re:JDK7 to have escape analysis on by default...also back po...
by sb on Wednesday October 07, 2009 @10:08AM
(#866732)
afair, the most important optimization there is that something can be allocated on the stack instead of the heap, which is quite an optimization. EDIT: it does not actually have anything to do what you can stick in registers--at least nothing comes to my mind w/o thinking too hard about it...
relevant papers directly from the hotspot-jvm are:
-kotzmann, moessenboeck, "escape analysis in the context of dynamic compilation and deoptimization" http://www.usenix.org/events/vee05/full_papers/p111-kotzmann...
-kotzmann, moessenboeck: "run-time support for optimizations based on escape analysis" http://ftp.ssw.uni-linz.ac.at/Research/Papers/Ko07/Ko07.pdf
Re:JDK7 to have escape analysis on by default...also back po...
by slava_pestov on Wednesday October 07, 2009 @11:19AM
(#866868)
Actually, once you've figured out that you can stack allocate an object, you can stick its instance variables in registers. This can be a huge win.
Re:JDK7 to have escape analysis on by default...also back po...
by luke_s on Wednesday October 07, 2009 @10:27PM
(#868119)
"The Java language does not offer any way to explicitly allocate an object on the stack, but this fact doesn't prevent JVMs from still using stack allocation where appropriate. JVMs can use a technique called escape analysis, by which they can tell that certain objects remain confined to a single thread for their entire lifetime, and that lifetime is bounded by the lifetime of a given stack frame. Such objects can be safely allocated on the stack instead of the heap. Even better, for small objects, the JVM can optimize away the allocation entirely and simply hoist the object's fields into registers."
Taken from an IBM developerworks article here: http://www.ibm.com/developerworks/java/library/j-jtp09275.ht...