6

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

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
hbelmiro
  • 987
  • 11
  • 31
  • 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. – assylias Jul 27 '16 at 12:55

2 Answers2

1

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.

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.

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259