Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255885

Metaspace: freelist commit counter is not updated when purging

XMLWordPrintable

    • 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.)

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: