<p dir="ltr">Hi<br>
In the application I'm working on E have a plugin system with each plugin having its own class loader.<br>
So loading the same class in each plugin will practically means loading it 100x.<br>
In such cases we could easily load a very big number of classes.<br>
Would it cause issues with compact headers?</p>
<br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le mer. 14 mai 2025, 03:50, John Rose <<a href="mailto:john.r.rose@oracle.com">john.r.rose@oracle.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">That estimate (4M classes) is a known <strong>soft</strong> limit.</p>
<p dir="auto">There are many, many ways to raise that number!</p>
<p dir="auto">This old thread has just a few:<br>
<a href="https://mail.openjdk.org/pipermail/lilliput-dev/2024-June/001760.html" style="color:#3983c4" target="_blank" rel="noreferrer">https://mail.openjdk.org/pipermail/lilliput-dev/2024-June/001760.html</a></p>
<p dir="auto">I also look forward to any reports on large numbers of<br>
loaded classes. I wonder if anyone’s actually studying that.</p>
<p dir="auto">A jokey upper bound would be the number of classfiles in<br>
some big slice through Maven. It’s jokey because nobody<br>
loads them all at once, of course, and there are also<br>
class spun online. Maybe someone can do better than that?<br>
Maybe a maximal dependency graph among Maven jars?<br>
(Mild nerd sniping here…)</p>
<p dir="auto">On 13 May 2025, at 17:11, David Alayachew wrote:</p>
</div><blockquote style="margin:0 0 5px;padding-left:5px;border-left:2px solid #777777;color:#777777"><div id="m_101589024541011428699A1898-A09E-4296-9FFC-C91D2ECEFC98">
<p dir="ltr">Thanks for the response Alex.</p>
<p dir="ltr">Ok, that link was helpful. I can see now that there is definitely a known limit, and the JEP preceding this one is aware of that limit and designed around it. All I am missing now is what happens when we go past that limit. Hopefully Roman can answer that.</p>
<p dir="ltr">Thanks again Alex.</p>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 13, 2025, 7:33 PM Alex Buckley <<a href="mailto:alex.buckley@oracle.com" target="_blank" rel="noreferrer">alex.buckley@oracle.com</a>> wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 5/13/2025 4:06 PM, David Alayachew wrote:<br>
> Silly question -- what happens if you use this feature, but end up with<br>
> more classes than can fit in the class' object header? I like to think<br>
> of myself as aware of my project's performance metrics, but the number<br>
> of classes loaded is not a detail I track.<br>
<br>
Not silly -- considered in the prior JEP -- see "Compressed class<br>
pointers encoding" in <a href="https://openjdk.org/jeps/450#Risks-and-Assumptions" rel="noreferrer noreferrer noreferrer" target="_blank">https://openjdk.org/jeps/450#Risks-and-Assumptions</a><br>
<br>
The abstract JVM has no limit to the number of loaded classes (see JVMS<br>
4.11 for things that do have limits). Maybe Roman can say how much<br>
stress testing has been performed with the HotSpot implementation to<br>
discover the practical limit to the number.<br>
<br>
Alex<br></blockquote>
</div></div></blockquote>
<div style="white-space:normal">
</div></div></div>
</blockquote></div>