Escape Analysis
A compiler analysis that determines whether an allocated object can become visible outside its creating scope, enabling optimizations such as scalar replacement.
JVM Runtime Context
Escape analysis determines whether an object can become visible outside the scope in which it is created. When the compiler proves that identity or heap materialization is unnecessary, it may enable allocation elimination, scalar replacement, or lock elimination after inlining and call-graph analysis.
Optimization Boundary
The presence of escape analysis does not imply that every short-lived object is allocated on the stack or eliminated. The result depends on compiler implementation, inlining, compilation tier, and the code shape seen by the optimizer.
Related JVM Concepts
- Scalar Replacement
- Just-In-Time Compilation
- Allocation
- Inlining