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

ZGC: Lazily initialize livemap

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • hotspot
    • gc
    • b15

      Memory for the bitmap inside the livemap of a ZPage is currently allocated upon calling its constructor, which adds a latency overhead when allocating pages. As preparation for the Mapped Cache ([JDK-8350441](https://bugs.openjdk.org/browse/JDK-8350441)), but also as a standalone improvement, we want to instead lazily initialize the livemap's bitmap.

      This patch holds off with allocating memory for the bitmap that the livemap uses until the livemap is written to the first time (i.e. by calling ZLiveMap::set). The effect of this is that the latency impact of allocating the bitmap will only be taken by GC threads and not by mutator threads, since only GC threads mark objects before pushing them onto the mark stack (as implemented in JDK-8260267). This improvement will reduce page allocation latencies somewhat.

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

              Created:
              Updated:
              Resolved: