> Hello,
> 
> In the development of Automatic Heap Sizing (AHS) for ZGC we run into 
> intermittent failures in the ClassesByName2Test.java test, and also 
> RedefineCrossEvent.java which runs ClassesByName2Test.java.
> 
> In AHS we are running GCs more frequently, which affects how often classes 
> are unloaded for example. In the tests mentioned above, we see that 
> LambdaForm classes are unloaded before we call `vm().classesByName(name)`, 
> which fails the test. 
> 
> LambdaForm classes are hidden, so they can be unloaded independently of their 
> class loader. I suggest we make this test more robust by skipping 
> verification of hidden classes, which include the LambdaForm classes we've 
> observed so far. Checking for a slash `/` should be enough to determine if a 
> class is hidden or not. A "valid"/"normal" Java class should not have a slash 
> in their name, as specified by "normal" classes having a "binary name", which 
> can't include a slash. See 
> [https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/Class.html#getName()](https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/Class.html#getName())
>  for details on the class name returned by `getName()`.
> 
> Another way to get a similar failure to this in mainline is to run with the 
> following JVM flags, which also runs frequent GCs:
> 
> -XX:+UseZGC -XX:+ZCollectionIntervalOnly -XX:ZCollectionIntervalMajor=0.001
> 
> 
> I've also removed the commented-out print, which was very useful in debugging 
> this.
> 
> Testing:
> * We've not been able to see failures for this test after this fix.
> * Oracle's tier1, tier2 and tier6 (where we've observed failures so far)
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Joel Sikström has updated the pull request incrementally with one additional 
commit since the last revision:

  Revert 'Found class' print

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/30825/files
  - new: https://git.openjdk.org/jdk/pull/30825/files/9cf93293..9e97933b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=30825&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30825&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/30825.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30825/head:pull/30825

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

Reply via email to