What does the java option -XX:-EliminateAllocations do?
Asked Answered
L

2

7

What does the java option -XX:-EliminateAllocations do? I couldn't find any documentation about it.

Lissa answered 27/7, 2016 at 12:45 Comment(1)
It prevents the JIT from performing the "allocation elimination" optimisation which, I think, consists in skipping an object allocation by looking through to the object's fields directly.Papiamento
M
2

This key disables "Scalar replacement optimization"

Simply spoken when an object is identified as non-escaping the JVM can replace its allocation on the heap with an allocation of its members on the stack which mitigates the lack of user guided stack allocation. The optimization is enabled by default since JDK 6U23 in the hotspot server compiler.

More info.

Munro answered 18/8, 2016 at 15:39 Comment(0)
L
1

HotSpot JIT does eliminate local allocations by replacing object fields with variables. The optimization is called Scalar Replacement.
-XX:+EliminateAllocations JVM flag is for controling this optimization and it is ON by default.

Lumber answered 18/8, 2016 at 15:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.