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

Separate Metaspace and GC printing

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • gc

      I believe the main reason Metaspace and GC printing is tightly coupled is because, historically, the permanent generation (PermGen), which Metaspace replaced, was part of the GC heap. For this reason it made sense to print them simultaneously.

      With Metaspace replacing the PermGen, which uses native memory that is separate from the GC heap, the coupling has become more loose. A reason to still print Metaspace when printing the heap is that the GC is responsible for unloading classes and nmethods, which means it makes sense to print Metaspace information in connection to when a GC is performed.

      To better reflect the current state of the JVM, the following changes could be made to separate concerns:
      * Move Metaspace printing from HeapInfoDCmd to MetaspaceDCmd.
      * Move Metaspace printing from the "Heap:" section to "Metaspace:" section in vmError.cpp (hs_err files, the VM.info jcmd and -XX:+PrintVMInfoAtExit).
      * Use gc+exit instead of gc+heap+exit as tags for the LogTarget during exit printing to reflect that it's not only the heap being printed.
      * Separate Metaspace and GC Heap in the periodic printing before/after GC invocation(s).

            jsikstro Joel Sikstrom
            jsikstro Joel Sikstrom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: