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

JFR: Log chunk waste

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 24
    • 24
    • hotspot
    • None
    • jfr
    • b04

      When rewriting a file using the RecordingFile::write method it's possible to see which constants that are never referenced by an event and effectively wasted file space.

      The test TestWaste.java checks if more than 10% of a recording file is waste. To simplify debugging of waste issues, it would be helpful if the types that contributes to the waste are logged.

      To get a summary per chunk, a user can after the enhancement been checked in do:

          $ jfr scrub -J-Xlog:jfr+system+parser=debug recording-with-waste.jfr
          ...
          [0.414s][debug][jfr,system,parser] Total chunk waste by jdk.types.Bytecode: 2585 bytes.
          [0.414s][debug][jfr,system,parser] Total chunk waste by jdk.types.CompilerPhaseType: 1723 bytes.
          [0.414s][debug][jfr,system,parser] Total chunk waste by jdk.types.VMOperationType: 1602 bytes.
          ...

      To see every individual constant that is not used:

          $ jfr scrub -Xlog:fr+system+parser=trace recording-with-waste.jfr
          ...
          [0.128s][trace][jfr,system,parser] Unreferenced constant ID 7 of type jdk.types.G1YCType using 7 bytes
          [0.128s][trace][jfr,system,parser] Unreferenced constant ID 0 of type jdk.types.G1HeapRegionType using 7 bytes
          ...

            egahlin Erik Gahlin
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: