<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">> Why would we still need `-UseCompressedClassPointers`? Two reasons:<o:p></o:p></p>
<p class="MsoNormal">> …<o:p></o:p></p>
<p class="MsoNormal">> 2) To load more than ~5-6 million classes….<span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">CodeCache size limit is 2G for all platforms.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">If those classes methods get JIT compiled, it is unlikely generated code will fit into CodeCache.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">-Evgeny Astigeevich<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:36.0pt"><b><span style="font-family:"Calibri",sans-serif;color:black">From:
</span></b><span style="font-family:"Calibri",sans-serif;color:black">hotspot-dev <hotspot-dev-retn@openjdk.org> on behalf of Thomas Stüfe <thomas.stuefe@gmail.com><br>
<b>Date: </b>Tuesday 4 February 2025 at 11:52<br>
<b>To: </b>hotspot-dev <hotspot-dev@openjdk.org><br>
<b>Cc: </b>"Kennke, Roman" <rkennke@amazon.de><br>
<b>Subject: </b>[EXTERNAL] Deprecate -UseCompressedClassPointers?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="622" style="width:466.5pt;margin-left:36.0pt;border-collapse:collapse">
<tbody>
<tr style="height:15.25pt">
<td width="622" valign="top" style="width:466.5pt;border:solid #ED7D31 1.5pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.25pt">
<p><strong><span style="font-family:"Aptos",sans-serif;color:black;background:#FFFF99">CAUTION</span></strong><span style="color:black;background:#FFFF99">: This email originated from outside of the organization. Do not click links or open attachments unless
you can confirm the sender and know the content is safe.</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><br>
Hi all,<br>
<br>
I would like to get rid of the `-UseCompressedClassPointers` case since it would cut down the number of configurations we need to support and test from three to two (`-UseCompressedClassPointers`, `+UseCompressedClassPointers`, `+UseCompactObjectHeaders`).<br>
<br>
This would leave us with the now default case, `+UseCompressedClassPointers`, as the sole supported CCP case, thereby removing the need for the switch, which we therefore should deprecate and eventually remove.<br>
<br>
Apart from significantly reducing code complexity and testing effort, `-UseCompressedClassPointers` does not seem to be tested that well, especially on 64-bit platforms. See e.g.
<a href="https://github.com/openjdk/jdk/pull/23053">https://github.com/openjdk/jdk/pull/23053</a>, and Roman's suspicion is that there are many more.<br>
<br>
It increases memory usage by quite a bit ("Alias for -XX:WasteMemory" - Erik Österlund), and any historical connection to UseCompresseedOops have long been removed.
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><br>
Why would we still need `-UseCompressedClassPointers`? Two reasons:<br>
<br>
1) To support 32-bit, where, atm, it is the only implemented mode. But I am confident that I can find some low-effort low-code way to "fake" compressed Klass* pointers, since after all the 32-bit address space could be seen as a 4GB class space. There is also
the bigger question of the future of 32-bit - we discussed this at the FOSDEM OpenJDK workshop, with mixed results, but it seems likely that 32-bit will go away at some point, the only question is when.<br>
<br>
2) To load more than ~5-6 million classes. Class space, when maxed out, allows for about 5-6 million classes, given a typical Klass size distribution. I think that number is ridiculous, though. If you load or generate that many classes, you are a likely very
patient programmer with a leaky or misdesigned application (just consider for a moment that to fill 4GB class space to the brim with Klass instances, would would typically use up about 5-10 times as much in non-class metaspace. That is for metadata alone.
I cannot see a sane application doing that.<br>
<br>
Is anyone using -UseCompressedClassPointers for any valid reason I am not aware of?<br>
<br>
If not, barring any objections, my plan is to deprecate UseCompressedClassPointers for JDK25, find an alternative for 32-bit platforms in JDK26, and remove the uncompressed case in JDK 26 or later.
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">What do people think?<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<br><br><br>Amazon Development Centre (London) Ltd.Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.<br><br><br>
</body>
</html>