Metaspace leak with instrumentation.retransform

Thomas Stüfe thomas.stuefe at gmail.com
Wed May 24 07:22:39 UTC 2023


On Wed, May 24, 2023 at 9:19 AM David Holmes <david.holmes at oracle.com>
wrote:

> On 24/05/2023 5:08 pm, David Holmes wrote:
> > Hi,
> >
> > On 24/05/2023 4:45 pm, Jean-Philippe Bempel wrote:
> >> Hi David,
> >>
> >> On Wed, May 24, 2023 at 7:02 AM David Holmes <david.holmes at oracle.com>
> >> wrote:
> >>>
> >>>> class MyClass {
> >>>>       private static void writeFile() {
> >>>
> >>> I don't see this ever getting called. Is some code missing?
> >>
> >> No code is missing, code is not executed, The whole class is
> >> re-transformed and just by the
> >> presence of this method with this code in the classfile trigger the
> issue
> >
> > Ah now I get it. So basically you're filling up metaspace faster than it
> > can be reclaimed. Other than class unloading I'm not sure what the
> > reclamation mechanism is, so I'll defer to Thomas at this point. We
> > definitely need to see more information such as logging or the jcmd
> > output Thomas suggested.
>
> That said, I'm at a loss to understand what affect the addSuppressed
> could possibly have here.
>
> David
>
>
It may influence the size of the new byte codes, making them consistently
larger than the old ones, thereby preventing space for old byte codes from
being reused.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20230524/4a1a55b0/attachment-0001.htm>


More information about the hotspot-dev mailing list