JDK-8243161 : Deprecate UseLargePagesInMetaspace
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 15
  • Submitted: 2020-04-20
  • Updated: 2020-05-15
  • Resolved: 2020-05-15
Related Reports
CSR :  
Description
Summary
-------

Deprecate the VM product option UseLargePagesInMetaspace.

Problem
-------

In the context of the upcoming Elastic Metaspace [1] it has been decided to scrap the large page support for Metaspace in its current form.

UseLargePagesInMetaspace switches on usage of large pages for a part of Metaspace. The current implementation has some drawbacks:

- It only works for the non-class-space part of Metaspace. The reason for that is that support for dynamically committing and uncommitting large pages is missing; large pages are always allocated when reserved, which would be incredibly wasteful for the Compressed Class Space, where the reserved-to-committed-ratio is usually very large.

- Its runtime benefits are small, barely raising above noise level.

- It increases complexity and the test coverage for this switch is low.

Since the benefits of that feature in its current form are too low to justify the added complexity and testing (which is not done but should be done), it has been decided to leave large page support out of the upcoming Metaspace rewrite.

Note that in the future we may re-evaluate this decision: if a new implementation were to provide dynamic committing and uncommitting of large pages it would be more useful than the current implementation and worth the added complexity. 

However, such a new implementation should be switched off under the control of the general "UseLargePages" switch - it should not require an individual switch. This is how large pages are controlled in other parts of the VM, e.g. in the Code Heap. That would also cut down on the number of configurations we need to test.

So even if large page support for Metaspace is reintroduced later, the switch UseLargePagesInMetaspace would not be needed.


Solution
--------

Declare the UseLargePagesInMetaspace option deprecated according to the process of removing Hotspot product options.

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

Use of -XX:UseLargePagesInMetaspace will print a deprecation warning in JDK 15, and in later releases, will print an obsolete warning and no longer have any effect on Metaspace allocation.

Comments
Moving to Approved.
15-05-2020

I changed these options to deprecate in 15 and obsolete in 16.
14-05-2020

Moving to Provisional.
04-05-2020

Since the Metaspace support will be changed in JDK 15 and this will not be implemented, this option should become obsolete rather than deprecated first.
28-04-2020

The one customer who may have been given this switch in JDK 8 for a specific situation/problem could resolve their problem by configuring the number of large pages appropriately, leaving good enough number of regular-sized pages for Metaspace so that it does not encounter any paging activity. This is text copied from a discussion with [~poonam].
28-04-2020