Could we get rid of the UseCompressedClasses switch altogether, defaulting to const true?

Roman Kennke rkennke at gmail.com
Wed Feb 28 17:00:30 UTC 2024


Hi there,

I searched around in Amazon a little bit and all of the (very few) uses of -CCP all come from Apache Spark, which has this interesting code:

https://github.com/apache/spark/blob/ea2587f695cf34c8561c91ffc342b38995bdeb43/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSparkSubmitSuite.scala#L45

Looks like they are doing it to get a particular alignment of array elements.

This will be shaken up by my recent push of:
https://bugs.openjdk.org/browse/JDK-8139457

Roman


> On Feb 22, 2024, at 3:34 PM, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
> 
> Greetings,
> 
> Are there any realistic scenarios that would require UseCompressedClassPointers=false? Or could we make it constant at some point or remove the switch altogether?
> 
> The only reason I can see for UseCompressedClassPointers=off would be if the maximum class space size of 3GB is not enough. But how realistic is this really? Some numbers:
> 
> On average, a Klass is ~600-700 bytes. Therefore, 3GB of class space would be enough for ~5 million classes. Note that the typical size ratio of Klass-to-non-class-metadata is 1:6 .. 1:10, which means that 3 GB class space come with ~18..30 GB of non-class metaspace (see [1]). I think these are outlandish numbers. Do we need to support these scenarios? Some weird class generator scenarios maybe?
> 
> Other than class space max size not being enough, are there any reasons for -UseCompressedClassPointers?
> 
> Thank you,
> 
> Thomas
> 
> [1] https://github.com/tstuefe/metaspace-statistics/blob/master/Histogram.svg
> 
> 



More information about the hotspot-gc-dev mailing list