In metaspace, the null class loader can "taint" the ReservedSpace for VirtualSpaceNodes. If the null class loader gets a chunk from a VirtualSpaceNode, then we will never purge that VirtualSpaceNode, since VirtualSpaceList::purge checks that vsl->container_count() == 0. Due to this, we can not release the ReservedSpace.
Not releasing the ReservedSpace means that the memory for the ReservedSpace can never be "reused" for chunk sizes other than the ones that was put on the ChunkFreeList from ~SpaceManager.
Not releasing the ReservedSpace means that the memory for the ReservedSpace can never be "reused" for chunk sizes other than the ones that was put on the ChunkFreeList from ~SpaceManager.
- relates to
-
JDK-8035945 Small Metaspace allocation requests can fail even though SmallChunks are available
- Closed
-
JDK-8251158 Implementation of JEP 387: Elastic Metaspace
- Resolved