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

Incorrect StartAggressiveSweepingAt doc for segmented code cache

XMLWordPrintable

      The `StartAggressiveSweepingAt` documentation:

      ```
        product(uintx, StartAggressiveSweepingAt, 10, \
                "Start aggressive sweeping if X[%] of the code cache is free." \
                "Segmented code cache: X[%] of the non-profiled heap." \
                "Non-segmented code cache: X[%] of the total code cache") \
      ```

      It says that in a case of the segmented code cache the percent of the free space of the non-profile heap is used to trigger sweeping.

      This is incorrect because according to the code: https://github.com/openjdk/jdk/blob/996790c70f902d7840d0649a6b0867bed47c6537/src/hotspot/share/code/codeCache.cpp#L782
      ```
      void CodeCache::gc_on_allocation() {
        ...
        size_t free = unallocated_capacity();
        size_t max = max_capacity();
        size_t used = max - free;
        double free_ratio = double(free) / double(max);
        if (free_ratio <= StartAggressiveSweepingAt / 100.0) {
      ```
      the usage of all allocable heaps is taken into account. `unallocated_capacity` and `max_capacity` traverse all such code heaps.

            Unassigned Unassigned
            eastigeevich Evgeny Astigeevich
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: