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

Cleanup and consolidate Metaspace coding

    Details

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

      Description

      Metaspace coding has grown and would benefit from a bit of code grooming.

      Note: out of scope for this enhancement is regrouping code to different files - see JDK-8176808.

      - ChunkManager::verify_free_chunks_total() and ChunkManager::verify_free_chunks_count() are not used anywhere and could be removed
      - ChunkManager::print_on is unused and seems only half implemented.
      - ~SpaceManager: do not print the same stuff twice
      - ChunkManager::locked_print_free_chunks() and ChunkManager::locked_print_sum_free_chunks() print exactly the same. locked_print_sum_free_chunks() gets its numbers by adding all (four) freelist statistics, whereas locked_print_free_chunks() just uses the running total in ChunkManager. Both are printed when a SpaceManager dies, so this leads to a repeated output
      - Consolidate the different versions of MetaspaceAux::print_on(), MetaspaceAux::dump() and MetaspaceAux::print_metadata_for_nmt()
         (DONE as part of JDK-8201572)
      - Consolidate MetaspaceAux::print_waste, MetaspaceAux::print_class_waste
         (DONE as part of JDK-8201572)
      - More const correctness would be nice.
      - rename MetaspaceAux::free_bytes() to something remotely useful, e.g. MetaspaceAux::committed_but_not_yet_allocated_bytes()
         (DONE as part of JDK-8201572)
      - rename MetaspaceAux to MetaspaceUtils
         (DONE, JDK-8199430)
      - split the Metaspace class into two classes. One class (ClassLoaderMetaspace) holds the metaspace for one classloader. The other class receives the static helper functions which are now part of class Metaspace. Potentially move parts of them to MetaspaceUtils.
         (DONE, JDK-8199431)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: