-
Bug
-
Resolution: Fixed
-
P4
-
16
-
b26
Metaspace chunks are uncommitted, under certain conditions, when being returned to the Metaspace by a dying class loader.
There are two places where this happens:
1) when individual chunks are returned (see ChunkManager::return_chunk_locked())
2) later, when CLDG::purge()->Metaspace::purge()->ChunkManager::purge() is called - all free chunks are again checked and potentially uncommitted.
Free chunks are kept in FreeChunkList. FreeChunkList has a counter for words-comitted. That counter gets updated when chunks are added and removed. However, path (2) does not change the list, it just uncommits chunks residing in that list. That passes under the FreeChunkList's radar and now the counter is off.
This is not a big deal (the counter is only used for statistics). But it should be fixed.
(Future todo: Path (2) is almost never taken. We may want to remove it, but not for jdk16.)
There are two places where this happens:
1) when individual chunks are returned (see ChunkManager::return_chunk_locked())
2) later, when CLDG::purge()->Metaspace::purge()->ChunkManager::purge() is called - all free chunks are again checked and potentially uncommitted.
Free chunks are kept in FreeChunkList. FreeChunkList has a counter for words-comitted. That counter gets updated when chunks are added and removed. However, path (2) does not change the list, it just uncommits chunks residing in that list. That passes under the FreeChunkList's radar and now the counter is off.
This is not a big deal (the counter is only used for statistics). But it should be fixed.
(Future todo: Path (2) is almost never taken. We may want to remove it, but not for jdk16.)
- blocks
-
JDK-8255884 Metaspace: chunk local commit counter may be stale
- Closed