RFR: 8311240: Create testcases.jar from test case

Daohan Qu dqu at openjdk.org
Fri Jul 7 13:21:05 UTC 2023


This patch eliminates the usage of `testcases.jar` from `TestMetaSpaceLog.java` and removes this jar file. IMHO, it is also what this issue intended to do. But now the issue name becomes sort of misleading.

As [this email](https://mail.openjdk.org/pipermail/hotspot-gc-dev/2018-September/023343.html) said, `TestMetaSpaceLog.java` (imported in [JDK-8211123](https://bugs.openjdk.org/browse/JDK-8211123)) tries to fill the metaspace, then do a full GC and check if metaspace size does shrink. It fills the metaspace by creating many new `URLClassLoader`s to load classes from an external jar file (`testcases.jar`).

Now we could use `jdk.test.lib.compiler.InMemoryJavaCompiler` and `jdk.test.lib.ByteCodeLoader` to achieve the same goal. In this way, we don't need this jar file at all and could remove it. (The similar idea has been proposed in [JDK-8211255](https://bugs.openjdk.org/browse/JDK-8211255) and also discussed in the email thread mentioned above. But that issue was closed and not fixed for some unknown reasons :() Anyway, leaving a binary file in VCS is not good.

-------------

Commit messages:
 - Remove usage of testcases.jar in TestMetaSpaceLog.java

Changes: https://git.openjdk.org/jdk/pull/14804/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14804&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8311240
  Stats: 28 lines in 2 files changed: 6 ins; 16 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/14804.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14804/head:pull/14804

PR: https://git.openjdk.org/jdk/pull/14804


More information about the hotspot-gc-dev mailing list