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

Roman Kennke rkennke at gmail.com
Fri Feb 23 10:43:59 UTC 2024


:-D

We do have a few service teams here at Amazon which use -UseCompressedClassPointers, I will ask around what might be the reasons for this.

Other than that, I would suggest to deprecate the switch ASAP and follow the usual process to get rid of it. In the (unlikely) case that anybody really needs it, it could be wired with -UseCompactObjectHeaders, once we have that, because -CCP would imply -COH anyway.

Cheerio,
Roman

> The use of UseCompressedClassPointers used to be intertwined weirdly with UseCompressedOops due to historic reasons. I broke that connection because we wanted compressed class pointers in ZGC, even though we don’t use compressed oops.
> 
> After that was cleaned up I tend to think of -XX:-UseCompressedClassPointers in my head as some kind of alias for -XX:+WasteMemory which you would configure purely because you want to waste memory just for the sake of it.
> 
> /Erik
> 
>> On 22 Feb 2024, at 15:35, 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