RFR: 8266891: Provide a switch to force the class space to a specific location

Coleen Phillimore coleenp at openjdk.java.net
Thu May 27 00:48:09 UTC 2021


On Tue, 11 May 2021 08:52:55 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> To test compressed Klass pointer encoding and other metaspace interna, it would be nice to be able to force location of the class space to a specific location. This would help with analysis of problems like JDK-8261552 or JDK-8265705 - errors in Klass* encoding/decoding which managed to stay unnoticed for an astonishingly long time.
> 
> For simplicity, it would be sufficient to only have this ability if CDS is disabled (Xshare=off), since CCS allocation is tied to CDS location otherwise and that would be more diffictult to disentangle.

This seems good.  Small comment. Were you going to add a test or did you want this to test manually?

src/hotspot/share/memory/metaspace.cpp line 716:

> 714:     // this may fail, in which case the VM will exit after printing an appropiate message.
> 715:     // Tests using this switch should cope with that.
> 716:     if (!FLAG_IS_DEFAULT(CompressedClassSpaceBaseAddress) && CompressedClassSpaceBaseAddress != 0) {

Don't you just have to test if CompressedClassSpaceBaseAddress != 0 , since that's the default if not set?

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

Marked as reviewed by coleenp (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3969


More information about the hotspot-runtime-dev mailing list