Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8228750

Deprecate product flag -XX:CompactFields

XMLWordPrintable

    • behavioral
    • minimal
    • No use cases should find any observable difference.
    • add/remove/modify command line option
    • Implementation

      Summary

      Deprecate the option -XX:CompactFields. By default it is true, and setting to false will not lead to better performance or any 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 causes fields smaller than long/double to be packed in the gap before the first long/double field in an object. There are no reasonable use cases to not do this. 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:+CompactFields ...'

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

      Specification

      Deprecate the -XX:CompactFields option in JDK-14 and issue the above warning message when the option is used.

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: