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

ZGC: Optimize copy constructors in ZPhysicalMemory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • hotspot
    • gc
    • master

      ZPhysicalMemory stores a sorted array of physical memory segments. Segments are added using either add_segments or add_segment, where the former calls add_segment on each individual segment. add_segment inserts segments in address order and also merges segments when possible.

      When copying an instance of ZPhysicalMemory, segments are currently copied using either add_segments or add_segment, which works as described above. This requires more work than necessary and should be simplified to account for the fact that the array of segments is always sorted.

      When copying, the copy constructors should instead use append or appendAll from the underlying GrowableArrayCHeap and also reserve enough memory so that the array's capacity is not increased more times than necessary during copying.

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

              Created:
              Updated:
              Resolved: