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

metaspace: fix wrong comment and condition in SpaceManager::verify()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b07

      Description

      The comment and the condition here are wrong:

      void SpaceManager::verify() {
        // If there are blocks in the dictionary, then
        // verification of chunks does not work since
        // being in the dictionary alters a chunk.
        if (block_freelists() != NULL && block_freelists()->total_size() == 0) {
           ....
        }
      }

      They used to make sense: in an earlier version of the Metaspace ("6964458: Reimplement class meta-data storage to use native memory") the Metablocks inside a metachunk always had headers and therefore were walkable. So, Metachunk::verify walked all the blocks - which was not possible if blocks were returned with Metaspace::deallocate() and added to the block dictionary.

      This is not true anymore, now MetaBlocks generally do not have a header, so MetaChunk::verify() does not walk them and is generally oblivious to anything happening in the MetaChunk payload area. So, one can now always call MetaChunk::verify(), regardless if MetaBlocks are in the block dictionary or not.


        Attachments

          Activity

            People

            Assignee:
            stuefe Thomas Stuefe
            Reporter:
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: