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

G1: Time-based heap size re-evaluation

XMLWordPrintable

    • gc

      JDK-8238687 evaluates and resizes the heap based on garbage collections, i.e. every garbage collection g1 resizes the heap.

      Doing heap sizing based on garbage collections has a big disadvantage: if there are no garbage collections (due to no application activity) there is a risk that a large amount of heap is kept committed unnecessarily for a long time.

      There needs to be some other form of regular re-evaluation of heap size to combat that.


      This also somewhat ties in with JDK-8213198 that is about regularly cleaning out other resources (although in that case it can happen that there is lots of gc activity, but just no whole heap analysis for a long time)

      There are also periodic GCs (JDK-8204089, JDK-8317755), but their functionality probably needs to be preserved as they are, or maybe they can be reused in some way (e.g. never triggering full gc).

      Another option is to regularly trigger a young gc (without concurrent start/whole heap analysis), but that may be a too large disruption.

      ZGC tracks last-used time of a region and regularly uncommits those that have not been in use for a certain amount of time (ZUncommitDelay; as the only strategy to free heap regions currently).

            mbeckwit Monica Beckwith
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: