Skip to content

Conversation

@david-a-wheeler
Copy link
Collaborator

We're getting absolutely hammered by systems doing various odd queries. I strongly suspect they are systems trying to get data for ML training. This intense use is slowly causing memory fragmentation in our Ruby on Rails application.

This attempts to resolve this by automatically compacting memory periodically.

We'll automatically do it
after we've served a request AND it's been "enough" time since the last time we compacted memory. This value is
controlled by BADGEAPP_GC_COMPACT_MINUTES with the default 120 minutes.

We're getting absolutely hammered by systems doing various odd queries.
I strongly suspect they are systems trying to get data for ML training.
This intense use is slowly causing memory fragmentation in our
Ruby on Rails application.

This attempts to resolve this by automatically compacting memory
periodically.

We'll automatically do it
after we've served a request AND it's been "enough" time since the
last time we compacted memory. This value is
controlled by BADGEAPP_GC_COMPACT_MINUTES with the default 120 minutes.

Signed-off-by: David A. Wheeler <[email protected]>
This fixes a Rubocop error and improves testing.

Signed-off-by: David A. Wheeler <[email protected]>
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (585ffdb) to head (320889a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2481   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           57        58    +1     
  Lines         2287      2311   +24     
=========================================
+ Hits          2287      2311   +24     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@david-a-wheeler david-a-wheeler merged commit dabe0dc into main Oct 17, 2025
10 checks passed
@david-a-wheeler david-a-wheeler deleted the auto_compact branch October 17, 2025 21:07
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.

1 participant