JDK: JDK25
Reproducible: Always
Test case: attached
We run an application which generates too many classes. JDK25's AOT is very promising for us but we are hitting the error :
```
[error][aot] [rw] capacity = 1073737728, allocated = 1073737656
[error][aot] required = 88
[error][aot] Unable to allocate from 'rw' region: Please reduce the number of shared classes.
[error][aot] An error has occurred while writing the shared archive file.
```
What happened (we believe):
- RW region has a 1GB default limit
- With 307,000 classes, RW allocation hits the limit
- AOT fails before even starting RO object allocation
We tried with CompressedClassSpaceSize options too:
### With CompressedClassSpaceSize=3.2GB (OOM Moves to RO Phase)
Using `-XX:CompressedClassSpaceSize=3439329280`:
```
[102.993s][info][aot] Allocating RW objects ...
[108.649s][info][aot] done (9595235 objects) ✓ RW COMPLETED!
[108.649s][info][aot] Allocating RO objects ...
[120.896s][error][aot] Out of memory in the CDS archive
```
**What happened:**
- RW allocation completes successfully with 9.6M objects
- OOM occurs during RO allocation phase
- This matches the real-world application pattern
We request to increase the AOT limit to higher values. All our investigation is added in README.md too.
Reproducible: Always
Test case: attached
We run an application which generates too many classes. JDK25's AOT is very promising for us but we are hitting the error :
```
[error][aot] [rw] capacity = 1073737728, allocated = 1073737656
[error][aot] required = 88
[error][aot] Unable to allocate from 'rw' region: Please reduce the number of shared classes.
[error][aot] An error has occurred while writing the shared archive file.
```
What happened (we believe):
- RW region has a 1GB default limit
- With 307,000 classes, RW allocation hits the limit
- AOT fails before even starting RO object allocation
We tried with CompressedClassSpaceSize options too:
### With CompressedClassSpaceSize=3.2GB (OOM Moves to RO Phase)
Using `-XX:CompressedClassSpaceSize=3439329280`:
```
[102.993s][info][aot] Allocating RW objects ...
[108.649s][info][aot] done (9595235 objects) ✓ RW COMPLETED!
[108.649s][info][aot] Allocating RO objects ...
[120.896s][error][aot] Out of memory in the CDS archive
```
**What happened:**
- RW allocation completes successfully with 9.6M objects
- OOM occurs during RO allocation phase
- This matches the real-world application pattern
We request to increase the AOT limit to higher values. All our investigation is added in README.md too.