RFR: 8308762: Metaspace leak with Instrumentation.retransform
Coleen Phillimore
coleenp at openjdk.org
Thu Jul 13 13:57:07 UTC 2023
On Thu, 6 Jul 2023 05:18:01 GMT, Jean-Philippe Bempel <jpbempel at openjdk.org> wrote:
> Fix a small leak in constant pool merging during retransformation of a class. If this class has a catch block with `Throwable`, the class `Throwable` is pre-resolved in the constant pool, while all the other classes are in a unresolved state. So the constant pool merging process was considering the entry with pre-resolved class as different compared to the destination and create a new entry. We now try to consider it as equal specially for Methodref/Fieldref.
I see. I was looking at jcod output but that doesn't distinguish resolved vs. unresolved class. At any rate, the verifier will re-resolve the class when it verifies the merged constant pool. It's still safe to consider these types as same.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14780#issuecomment-1634290376
More information about the hotspot-dev
mailing list