RFR: 8277072: ObjectStreamClass caches keep ClassLoaders alive [v2]
Peter Levart
plevart at openjdk.java.net
Mon Nov 29 13:55:12 UTC 2021
On Mon, 29 Nov 2021 13:47:19 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> I don't quite understand this: If the Class object is still reachable by the app,
1. a weak reference would not get cleared and
2. the Class's ClassLoader would not get unloaded.
...but the ObjectStreamClass instance could still get GC-ed, because it is held in the map using WeakReference<ObjectStreamClass>. The fact that associated Class is still reachable does not mean that the ObjectStreamClass instance is!
-------------
PR: https://git.openjdk.java.net/jdk/pull/6375
More information about the core-libs-dev
mailing list