Skip to content

Calculate VMRSS adjustments dynamically as OOM_SCORE_*/1000 of total memory#370

Open
RanHuang wants to merge 4 commits into
rfjakob:masterfrom
RanHuang:support_vmrss-adjust-percent
Open

Calculate VMRSS adjustments dynamically as OOM_SCORE_*/1000 of total memory#370
RanHuang wants to merge 4 commits into
rfjakob:masterfrom
RanHuang:support_vmrss-adjust-percent

Conversation

@RanHuang

Copy link
Copy Markdown
Contributor

This commit adds a new --vmrss-adjust-percent command-line option that allows users to set the VMRSS adjustment value as a percentage of total memory instead of using the fixed 3 GiB default.

Key changes:

  • Add --vmrss-adjust-percent option to set VMRSS adjustment as percentage
    of total memory for --prefer/--avoid processes when using --sort-by-rss
  • Store vmrss_adjust_percent and total_memory_kib in poll_loop_args_t
  • Calculate dynamic VMRSS adjustments based on percentage if specified
  • Maintain backward compatibility with fixed 3 GiB default values
  • Update documentation in MANPAGE.md and README.md
  • Add validation for percentage value (0-100)

@RanHuang

Copy link
Copy Markdown
Contributor Author

Execution Results and Test Screenshots

image image

@rfjakob

rfjakob commented Mar 18, 2026

Copy link
Copy Markdown
Owner

Hi, thanks, but I don't think this should be adjustable.

Please, instead, change it to add or subtract OOM_SCORE_PREFER/1000 of total memory. This will make --sort-by-rss match what happens without --sort-by-rss.

@RanHuang RanHuang changed the title add --vmrss-adjust-percent option for dynamic VMRSS adjustment Calculate VMRSS adjustments dynamically as OOM_SCORE_*/1000 of total memory Mar 19, 2026
@RanHuang

Copy link
Copy Markdown
Contributor Author

I've made adjustments according to your suggestion, using OOM_SCORE_PREFER and OOM_SCORE_AVOID to calculate the VMRSS adjustment values.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants