JDK-8228754 : Deprecate -XX:FieldsAllocationStyle product option
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 14
  • Submitted: 2019-07-29
  • Updated: 2019-08-15
  • Resolved: 2019-08-05
Related Reports
CSR :  
Description
Summary
-------

Deprecate the option -XX: FieldsAllocationStyle option.  By default it is 1 and other values will not lead to better performance or observable benefits.

Problem
-------

Flags allowing users to affect the layout of fields in Java classes give users unwelcome control over internal implementation details.  This option determines allocation order of fields:

    "0 - type based with oops first, "
    "1 - with oops last, "
    "2 - oops in super and sub classes are together"

Testing when the option was created showed that allocation style 1 was best, and this option has not been used by customers for performance improvements.

With @contended, padding can be added to prevent false sharing, if needed.

Deprecating and removing this option will allow for efficient implementation of inline types for valhalla.

Solution
--------

Deprecate the option and continue affect layout with the option.

Users will now get the following message when running: 'java -XX:+FieldsAllocationStyle ...'

Java HotSpot(TM) 64-Bit Server VM warning: Option FieldsAllocationStyle was deprecated in version 14.0 and will likely be removed in a future release.

Specification
-------------

Deprecate the -XX: FieldsAllocationStyle option in JDK-14 and issue the above warning message when the option is used.
Comments
Moving to Approved.
05-08-2019

Based on performance results I agree with flag's deprecation and using only code which corresponds to flag's default value 1.
01-08-2019

I think we need new performance results with latest JDK to see if FieldsAllocationStyle has effects. And if current default value is best.
30-07-2019