[8u] RFR 8151486: Class.forName causes memory leak

Andrew John Hughes gnu.andrew at redhat.com
Thu Jul 4 16:40:51 UTC 2019



On 02/07/2019 11:32, Aleksey Shipilev wrote:
> Original bug:
>   https://bugs.openjdk.java.net/browse/JDK-8151486
>   http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/1f044f413e6c
> 
> The product change is exactly the same. I had to massage the test to work on 8u, though:
> jdk.testlibrary.JarUtils is in different place, and has a little different method we should use for
> createJarFile. The test fails without the product change, and passes with it.
> 
> 8u webrev:
>    http://cr.openjdk.java.net/~shade/8151486/webrev.8u.01/
> 
> Testing: new test, "tier1"-like profile
> 

Looks fine.

I wonder if, long term, we should try and bring JarUtils into line.

It seems to have been introduced in 9 by JDK-8142968 (Module
Implementation, which we obviously can't backport) in
test/lib/testlibrary/JarUtils.java

But then JDK-8049171 (Additional tests for jarsigner's warnings) in 8u &
9u adds it as test/lib/testlibrary/jdk/testlibrary/JarUtils.java, so 9
actually ends up with two copies.

This seems to have been then later resolved by JDK-8180888: move
jdk.testlibrary.JarUtils to the top level testlibrary.

So JDK-8151486 was written against a different JarUtils introduced by
JDK-8142968 that isn't in 8u!
-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222
https://keybase.io/gnu_andrew



More information about the jdk8u-dev mailing list