RFR: JDK-8318485: Narrow klass shift should be zero if encoding range extends to 0x1_0000_0000

Thomas Stuefe stuefe at openjdk.org
Mon Oct 23 11:58:36 UTC 2023


On Fri, 20 Oct 2023 23:04:39 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> See JBS issue.
>> 
>> The real fix, trivial, is the comparison change in compressedKlass.cpp.
>> 
>> This patch then also adds a test that checks that for a given (forced) class space location the VM chose the correct encoding scheme. In this case, if class space nestles below and ends at 4G, we should use a shift of 0.
>> 
>> The test can be easily extended to test more narrow Klass encoding schemes. Note that the test is skipped if the VM could not map at the expected address to begin with.
>> 
>> Finally, to analyze test errors, I print out the mappings at the force address if metaspace logging is debug.
>> 
>> Tests: manual, GHA. x86 GHA errors unrelated.
>> 
>> 
>> Attention @iklam and @calvinccheung
>
> src/hotspot/share/memory/metaspace.cpp line 791:
> 
>> 789:         if (lt.is_enabled()) {
>> 790:           LogStream ls(lt);
>> 791:           os::print_memory_mappings((char*)base, size, &ls);
> 
> I saw the above log message as follows:
> 
> java -XX:+UnlockDiagnosticVMOptions -XX:CompressedClassSpaceBaseAddress=0xa0000000 -XX:CompressedClassSpaceSize=1g -Xlog:metaspace=debug -Xlog:os+map=trace -Xshare:off -version
> [0.001s][info][metaspace]  - commit_granule_bytes: 65536.
> [0.001s][info][metaspace]  - commit_granule_words: 8192.
> [0.001s][info][metaspace]  - virtual_space_node_default_size: 8388608.
> [0.001s][info][metaspace]  - enlarge_chunks_in_place: 1.
> [0.001s][info][metaspace]  - use_allocation_guard: 0.
> [0.036s][debug][metaspace] Range [a0000000-e0000000) contains: 
> [0.036s][debug][metaspace] a0000000-120000000 rw-p 00000000 00:00 0 
> [0.036s][debug][metaspace] 
> Error occurred during initialization of VM
> CompressedClassSpaceBaseAddress=0x00000000a0000000 given, but reserving class space failed.
> 
> Is it easy to get rid of the blank line before the line begins with "Error occurred..."?

Okay.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16261#discussion_r1368546190


More information about the hotspot-runtime-dev mailing list