RFR: 8338526: Don't store abstract and interface Klasses in class metaspace [v4]

Coleen Phillimore coleenp at openjdk.org
Thu Aug 29 17:48:21 UTC 2024


On Thu, 29 Aug 2024 17:45:17 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> I now read the JIRA issue. JFR do process loads of  java/lang/invoke/LambdaForm$MH and derivatives.
>
> It's fine to have each Klass* report whether it can be compressed. If not, it will be represented using the non-compressed version, which will be a bit more bloated, but no problems.

narrowKlass is the result of encoding Klass* with CompressedKlassPointers::encode() which is relative to the compressed base, so if UseCompressedClassPointers is false then the encoding to narrowKlass from some other (CDS?) base isn't valid.
using_class_space() above doesn't look wrong for 32 bits.  It should return false.

With this patch, interface and abstract classes cannot be encoded and decoded to yield a valid compressed narrowKlass, since they're now allocated in the non-class metaspace.  Yes, this now a function of which space the Klass resides in.  We do crash for these classes in JFR without this change.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19157#discussion_r1736816371


More information about the core-libs-dev mailing list