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

Deprecate product flag -XX:CompactFields

    XMLWordPrintable

    Details

    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      No use cases should find any observable difference.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      Implementation

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: