Skip to content

Add --oom-avoid-bytes option to stress-ng tests to prevent frequent OOM (bugfix)#1722

Merged
Hook25 merged 2 commits intomainfrom
1391-avoid-oom-memory-stress
Feb 20, 2025
Merged

Add --oom-avoid-bytes option to stress-ng tests to prevent frequent OOM (bugfix)#1722
Hook25 merged 2 commits intomainfrom
1391-avoid-oom-memory-stress

Conversation

@pieqq
Copy link
Copy Markdown
Collaborator

@pieqq pieqq commented Feb 13, 2025

Description

Recent versions of stress-ng include the --oom-avoid-bytes option to specify how much free memory should be kept un-allocated to try to give enough headroom to avoid the OOM killer from terminating processes.

Adding this option to the main stress-ng command with a threshold of 10%.

See discussion in ColinIanKing/stress-ng#270 for more information.

Resolved issues

Documentation

Tests

Tested on a desktop image running 24.04, with the latest version of Checkbox snap modified to use the new option in this patch:

  • before, the stress test crashes with kernel panic in the logs
  • after, the test completes and Checkbox provides an output

Recent versions of stress-ng include the --oom-avoid-bytes option to
specify how much free memory should be kept un-allocated to try to give
enough headroom to avoid the OOM killer from terminating processes.

Adding this option to the main stress-ng command with a threshold of
10%.

See discussion in ColinIanKing/stress-ng#270 for
more information.
@pieqq pieqq changed the title Add --oom-avoid-bytes option to stress-ng tests to prevent frequent OOM Add --oom-avoid-bytes option to stress-ng tests to prevent frequent OOM (bugfix) Feb 13, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.21%. Comparing base (be3c647) to head (6078f71).
Report is 140 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1722      +/-   ##
==========================================
+ Coverage   49.12%   49.21%   +0.09%     
==========================================
  Files         372      373       +1     
  Lines       40339    40419      +80     
  Branches     6809     6826      +17     
==========================================
+ Hits        19817    19894      +77     
- Misses      19799    19800       +1     
- Partials      723      725       +2     
Flag Coverage Δ
provider-base 0.00% <100.00%> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Hook25
Hook25 previously approved these changes Feb 17, 2025
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

Can you see if the option exists on core16? (check via version!)

@pieqq
Copy link
Copy Markdown
Collaborator Author

pieqq commented Feb 17, 2025

Can you see if the option exists on core16? (check via version!)

This tag was added in v0.15.06.

We use Colin King's stress-ng PPA to build our snaps, and Xenial is still a supported version (current version there is 0.18.09, like all the other supported versions of Ubuntu), so we should be good.

@Hook25
Copy link
Copy Markdown
Collaborator

Hook25 commented Feb 20, 2025

Can confirm

(checkbox-shell) [h25@h25 checkbox]$ stress-ng --version
stress-ng, version 0.18.09 (gcc 5.4.0, x86_64 Linux 6.13.2-arch1-1)

@Hook25 Hook25 merged commit 0ebe2c4 into main Feb 20, 2025
41 checks passed
@Hook25 Hook25 deleted the 1391-avoid-oom-memory-stress branch February 20, 2025 08:52
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