RFR: 8280041: Retry loop issues in java.io.ClassCache
Aleksey Shipilev
shade at openjdk.java.net
Fri Jan 14 19:56:43 UTC 2022
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`
- [ ] Linux x86_64 fastdebug `tier2`
- [ ] Linux x86_64 fastdebug `tier3`
-------------
Commit messages:
- Fix
Changes: https://git.openjdk.java.net/jdk/pull/7092/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7092&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8280041
Stats: 6 lines in 1 file changed: 4 ins; 1 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/7092.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7092/head:pull/7092
PR: https://git.openjdk.java.net/jdk/pull/7092
More information about the core-libs-dev
mailing list