Integrated: 8283276: java/io/ObjectStreamClass/ObjectStreamClassCaching.java fails with various GCs

Peter Levart plevart at openjdk.org
Thu Aug 4 13:29:05 UTC 2022


On Fri, 29 Jul 2022 09:05:53 GMT, Peter Levart <plevart at openjdk.org> wrote:

> This is a continuation of effort from https://github.com/openjdk/jdk/pull/9533 to fix the ObjectStreamClassCaching test which is failing with various GCs != G1. The test class contains 2 test methods:
> - test2CacheReleaseUnderMemoryPressure - this one was not logically changed at all - just one method was inlined
> - test1CacheEffectiveness - this one now uses a different strategy which doesn't involve calling System.gc() in order to trigger reference processing in GC which is, as test failures reveal, sometimes to aggressive and triggers processing not only WeakReference(s) but also SoftReference(s). Instead, the test now gradually builds up memory pressure while checking what's happening to two WeakReference(s): ref1 - wrapping a cached ObjectStreamClass instance; and: ref2 - wrapping a new Object() instance. The "effectiveness" of caching is confirmed by verifying that weakly reachable new Object() referent of ref2 is GC-ed earlier than softly reachable ObjectStreamClass referent of ref1.
> The test now contains several @run(s) with explicitly selected set of GC algorithms: G1, Parallel, ZGC, Shenandoah.

This pull request has now been integrated.

Changeset: d4a795d7
Author:    Peter Levart <plevart at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d4a795d75aef8d787934f5c05e146c61138a408a
Stats:     96 lines in 1 file changed: 69 ins; 11 del; 16 mod

8283276: java/io/ObjectStreamClass/ObjectStreamClassCaching.java fails with various GCs

Reviewed-by: rkennke, shade

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

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


More information about the core-libs-dev mailing list