RFR: 8376125: Out of memory in the CDS archive error with lot of classes [v3]

Ioi Lam iklam at openjdk.org
Tue Feb 3 08:14:03 UTC 2026


On Tue, 3 Feb 2026 07:55:47 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> > > The current limit gives us 4GB of encoding space; that is enough (with -UseCompressedKlassPointers) for roughly 5-6 million classes, possibly more. What scenario would require more classes than that?
> > 
> > 
> > The problem is that CDS stuffs all data (not just Klasses) into the ro/rw regions, which are mapped into the compressed class space. If we want to support millions of classes, we would need to split the classes out into its own region, and map only that into the CCS.
> 
> Ah, right. This is an issue. It would be very nice to solve that. How complex would it be?

We would add a new "class" region and reserve 4GB for it. Then the ro/rw regions would need to be moved to above the 4GB boundary, and they can grow to 32GB.

We are also thinking of mapping the code cache (which will hold both AOT and JIT compiled methods) at a fixed offset to the metadata, so we can map it at the 32 GB boundary, growing upwards.

In any case, that's not a problem I want to solve in the near future.

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

PR Comment: https://git.openjdk.org/jdk/pull/29494#issuecomment-3839752816


More information about the hotspot-dev mailing list