Skip to content

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Oct 6, 2025

The option was ignored if max-heap-size wasn't set. Also remove unused gc params option.

default-allowance-ratio represents the minimum amount of heap growth that we allow before triggering a new major collection, as a relative multiplier to the nursery size. Setting this option was always skipped if max_heap is not set, which is the common case (max_heap requires specific gc knobs to be configured). This option has nothing to do with the max_heap so make sure it is correctly initialized.
@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 13:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables proper configuration of the nursery allowance ratio in Mono's SGen garbage collector by fixing a bug where the option was ignored when max-heap-size wasn't set. Additionally, it removes unused save-target-ratio functionality to clean up the codebase.

  • Moves the allowance ratio configuration outside the max-heap conditional block so it applies regardless of heap size settings
  • Removes the unused save_target parameter and related code from the memory governor
  • Updates documentation and help text to reflect the removed experimental option

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/mono/mono/sgen/sgen-memory-governor.h Removes save_target parameter from sgen_memgov_init function signature
src/mono/mono/sgen/sgen-memory-governor.c Moves allowance ratio configuration outside max-heap conditional and removes save_target handling
src/mono/mono/sgen/sgen-gc.c Removes save-target-ratio option parsing and updates function call and help text
src/mono/mono/sgen/sgen-conf.h Removes save target ratio constants and documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant