JDK-8066875 : VirtualSpace does not use large pages
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-12-08
  • Updated: 2015-09-29
  • Resolved: 2015-01-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b49Fixed
Related Reports
Blocks :  
Relates :  
Description
In 'VirtualSpace::initialize' we use 'os::page_size_for_region' to determine the max_commit_granularity of the VirtualSpace. As a result we do not use large pages if the overall size is not large page aligned. However, we could still use large pages in the middle region by setting the size of the lower and upper region accordingly. For example, if we have a size of 241 MB we do not use large pages (4 MB)

Steps to reproduce on Solaris Sparc T4:

java -XX:+PrintCodeCache -XX:-SegmentedCodeCache Loop

CodeCache: size=245760Kb used=3470Kb max_used=3479Kb free=242289Kb
 bounds [0xffffffff69000000, 0xffffffff69370000, 0xffffffff78000000]
 total_blobs=316 nmethods=76 adapters=154
 compilation: enabled

pmap -s [PID]

FFFFFFFF69000000       4096K   4M rwx--    [ anon ]

As we can see, large pages (4M) are used here. Now with a non large page aligned code cache size (241M):

java -XX:+PrintCodeCache -XX:ReservedCodeCacheSize=241M -XX:-SegmentedCodeCache Loop

CodeCache: size=246784Kb used=3467Kb max_used=3474Kb free=243316Kb
 bounds [0xffffffff68c00000, 0xffffffff68f70000, 0xffffffff77d00000]
 total_blobs=315 nmethods=75 adapters=154
 compilation: enabled

pmap -s [PID]

FFFFFFFF68C00000        448K  64K rwx--    [ anon ]
FFFFFFFF68C70000        448K    - rwx--    [ anon ]
FFFFFFFF68CE0000        128K  64K rwx--    [ anon ]
FFFFFFFF68D00000        448K    - rwx--    [ anon ]
FFFFFFFF68D70000        128K  64K rwx--    [ anon ]
FFFFFFFF68D90000        448K    - rwx--    [ anon ]
FFFFFFFF68E00000         64K  64K rwx--    [ anon ]
FFFFFFFF68E10000        448K    - rwx--    [ anon ]
FFFFFFFF68E80000        192K  64K rwx--    [ anon ]
FFFFFFFF68EB0000        384K    - rwx--    [ anon ]
FFFFFFFF68F10000        384K  64K rwx--    [ anon ]

Instead of large pages we use 64K pages.