Integrated: 8280041: Retry loop issues in java.io.ClassCache

Aleksey Shipilev shade at openjdk.java.net
Tue Jan 25 19:24:43 UTC 2022


On Fri, 14 Jan 2022 19:27:18 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two issues with it:
>   - The cache cannot disambiguate between cleared SoftReference and the accidental passing of `null` value; in that case, the retry loop would spin indefinitely;
>   - If retry loop would spin several times, every time discovering a cleared SoftReference, it would create and register new SoftReference on the ReferenceQueue. However, it would not *drain* the RQ in the loop; in that case, we might have the unbounded garbage accumulating in RQ; 
> 
> Attention @rkennke, @plevart.
> 
> Additional testing:
>   - [x] Linux x86_64 fastdebug `java/io/ObjectStreamClass`
>   - [x] Linux x86_64 fastdebug `tier1`
>   - [x] Linux x86_64 fastdebug `tier2`
>   - [x] Linux x86_64 fastdebug `tier3`

This pull request has now been integrated.

Changeset: cebaad1c
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/cebaad1c94c301304fd146526cac95bfeaac66bf
Stats:     202 lines in 5 files changed: 190 ins; 0 del; 12 mod

8280041: Retry loop issues in java.io.ClassCache

Co-authored-by: Peter Levart <plevart at openjdk.org>
Reviewed-by: rkennke, rriggs, plevart

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

PR: https://git.openjdk.java.net/jdk/pull/7092


More information about the core-libs-dev mailing list