Fix Version/s: 15
Compatibility Risk Description:This switch appears to have been given in one customer situation in JDK 8 but the customer could reconfigure their large pages before upgrading to JDK 15.
Interface Kind:add/remove/modify command line option
Deprecate the VM product option UseLargePagesInMetaspace.
In the context of the upcoming Elastic Metaspace  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.
Declare the UseLargePagesInMetaspace option deprecated according to the process of removing Hotspot product options.
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.