RFR: 8283276: java/io/ObjectStreamClass/ObjectStreamClassCaching.java fails with various GCs
Peter Levart
plevart at openjdk.org
Mon Jul 25 13:36:03 UTC 2022
On Mon, 25 Jul 2022 13:13:30 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> > Just a note that the failing test is not about checking that cache is cleared after plain System.gc(), but about checking that cache is NOT cleared after System.gc() when there was no real memory pressure. The cache uses SoftReference(s). So it appears that some gc(s) do clear SoftReference(s) on System.gc(). Does WhiteBox GC util have a means to provoke gc without SoftReference processing?
>
> As I said above, there seem to be no such method. It would require hacking into each GC policy to prevent weakrefs clearing.
Just to be on the same page... It is not about weakref clearing but about softref clearing. The test assumes that System.gc() would not clear a softref on the 1st call at least.
-------------
PR: https://git.openjdk.org/jdk/pull/9533
More information about the core-libs-dev
mailing list