Metaspace leak with instrumentation.retransform

Jean-Philippe Bempel jean-philippe.bempel at datadoghq.com
Thu May 25 07:38:03 UTC 2023


Hi David,

I did more investigation and reduced the issue to a more minimalist
reproducer that you can see into the ticket [0].
to sum up here the minimal class to be re-transformed to reproduce:

class MyClass {
    private static void writeFile() {
        try {
            int i = 42;
        } catch (Throwable var4) {
            var4.printStackTrace();
        }
    }
}

If you change the type of the exception in catch from Throwable to
Exception, the issue is gone. There is a strong correlation with how
Redefine operation is handling the merging of the constant pool
between the 2 cases (Throwable or Exception catch type). you can find
more detail in the ticket.

Jean-Philippe Bempel

[0]: https://bugs.openjdk.org/browse/JDK-8308762

On Thu, May 25, 2023 at 8:40 AM David Holmes <david.holmes at oracle.com> wrote:
>
> Okay so adding a println instead should achieve the same thing.
> Jean-Philippe can you test that out?
>
> Cheers,
> David
>


More information about the hotspot-dev mailing list