RFR: 8283276: java/io/ObjectStreamClass/ObjectStreamClassCaching.java fails with various GCs
Aleksey Shipilev
shade at openjdk.org
Fri Jul 22 10:53:04 UTC 2022
On Fri, 22 Jul 2022 10:46:57 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> TBH, not certain how GC policies play into that, and how well WB is supported in each GC. Might be worth trying?
> Other that that, how does removinch System.gc() help make the test more reliable?
When you call `System.gc()` on some collectors, they blow out the weak references, which includes the cache in question. The assert then fails, thinking there was no reason to clear the cache. That is, the assert assumes the "memory pressure" is the only way the cache would be dropped, which is evidently not true.
-------------
PR: https://git.openjdk.org/jdk/pull/9533
More information about the core-libs-dev
mailing list