8000 gh-132917: Check resident set size (RSS) before GC trigger. by nascheme · Pull Request #133399 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-132917: Check resident set size (RSS) before GC trigger. #133399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use atomic load for deferred_count.
  • Loading branch information
nascheme committed May 4, 2025
commit 452cd0851260b01030e6e72418c72b576f0a0fa2
3 changes: 2 additions & 1 deletion Python/gc_free_threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,8 @@ gc_should_collect_rss(GCState *gcstate)
return true;
}
int threshold = gcstate->young.threshold;
if (gcstate->deferred_count > threshold * 40) {
Py_ssize_t deferred = _Py_atomic_load_ssize_relaxed(&gcstate->deferred_count);
if (deferred > threshold * 40) {
// Too many new container objects since last GC, even though RSS
// might not have increased much. This is intended to avoid resource
// exhaustion if some objects consume resources but don't result in a
Expand Down
0