Java 6 introduces stack allocation

October 2nd, 2005

Turns out that Java 6 will introduce a compiler optimisation called “escape analysis”.

Escape analysis is an optimization that has been talked about for a long time, and it is finally here — the current builds of Mustang (Java SE 6) can do escape analysis and convert heap allocation to stack allocation (or no allocation) where appropriate. The use of escape analysis to eliminate some allocations results in even faster average allocation times, reduced memory footprint, and fewer cache misses. Further, optimizing away some allocations reduces pressure on the garbage collector and allows collection to run less often.

Escape analysis can find opportunities for stack allocation even where it might not be practical to do so in the source code, even if the language provided the option, because whether a particular allocation gets optimized away is determined based on how the result of an object-returning method is actually used in a particular code path. The Point returned from getLocation() may not be suitable for stack allocation in all cases, but once the JVM inlines getLocation(), it is free to optimize each invocation separately, offering us the best of both worlds: optimal performance with less time spent making low-level, performance-tuning decisions.

http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html

loan $50,000 high riskland refinace loans alabamaloan bad credit 50,000 cashbill add a to loan calendarabout stafford loansloan personal all accepptedacquired loans reporting student creditcompany sloane and alanpersonal credit $5,000 loan bad withgrants loans adoption

Comments are closed.