Problem Statement
How can HotSpot’s escape analysis improve performance?
Explanation
If an object never escapes a method or thread, the JIT can allocate it on the stack (scalar replacement) and remove unnecessary synchronization, reducing GC pressure and contention.
Practice Sets
This question appears in the following practice sets:
