RFR: Use soft max capacity only for trigger calculations

Y. Srinivas Ramakrishna ysr at openjdk.org
Wed May 17 20:59:34 UTC 2023


On Wed, 17 May 2023 17:49:56 GMT, William Kemper <wkemper at openjdk.org> wrote:

> Use the soft max heap capacity only for the trigger's availability calculations. Our current generation sizing calculations cannot tolerate arbitrary changes to capacity. This use of soft max heap is consistent with original non-generational behavior. Here, the soft max heap capacity is applied directly as the heuristics view of the capacity of the young generation.

LGTM! Some minor comments.

src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 900:

> 898:   _affiliated_region_count(0), _humongous_waste(0), _used(0), _bytes_allocated_since_gc_start(0),
> 899:   _max_capacity(max_capacity), _soft_max_capacity(soft_max_capacity),
> 900:   _adjusted_capacity(max_capacity), _heuristics(nullptr) {

What is `_adjusted_capacity` used for and where? (Given that I see it start out here as being no different from `_max_capacity`, but I'll read on and see if I can find the answer.)

src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 114:

> 112:   virtual size_t available() const;
> 113: 
> 114:   size_t soft_available() const;

Please write a single line of documentation for the new field.

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 513:

> 511:   // for old would be total heap - minimum capacity of young. This means the sum of the maximum
> 512:   // allowed for old and young could exceed the total heap size. It remains the case that the
> 513:   // _actual_ capacity of young + old = total.

Not your change, but it seems like this comment might belong in the _declaration_ of `max_capacity()` (or of `_max_capacity`), rather than here?

-------------

Marked as reviewed by ysr (Committer).

PR Review: https://git.openjdk.org/shenandoah/pull/280#pullrequestreview-1431582721
PR Review Comment: https://git.openjdk.org/shenandoah/pull/280#discussion_r1197029505
PR Review Comment: https://git.openjdk.org/shenandoah/pull/280#discussion_r1197032341
PR Review Comment: https://git.openjdk.org/shenandoah/pull/280#discussion_r1197038174


More information about the shenandoah-dev mailing list