[mono][sgen] Enable configuration of nursery allowance ratio#120441
Merged
BrzVlad merged 2 commits intodotnet:mainfrom Nov 5, 2025
Merged
[mono][sgen] Enable configuration of nursery allowance ratio#120441BrzVlad merged 2 commits intodotnet:mainfrom
BrzVlad merged 2 commits intodotnet:mainfrom
Conversation
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.
It was never implemented or used
Contributor
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The option was ignored if max-heap-size wasn't set. Also remove unused gc params option.