Skip to content

Commit 353f12b

Browse files
committed
Allow full-mark GC during request handling
With full marks suppressed in Puma workers, a full mark ran only when Puma called the `out_of_band` hook on an idle worker, so a busy worker could go a long time without one. In another of our apps, this setting caused steady growth in old objects and memory. Remove `GC.config(rgengc_allow_full_mark: false)`. The `out_of_band` hook stays and still runs a major GC between requests when one is due.
1 parent da4fb42 commit 353f12b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎config/puma.rb‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@
3939
Process.warmup
4040
end
4141

42-
# Defer major GC (full marking phase) until after request handling,
43-
# and perform major GC deferred during request handling.
44-
before_worker_boot do
45-
GC.config(rgengc_allow_full_mark: false)
46-
end
47-
42+
# Opportunistically run major GC between requests when the VM signals
43+
# it's needed, preferring idle time over mid-request.
4844
out_of_band do
4945
GC.start if GC.latest_gc_info(:need_major_by)
5046
end

0 commit comments

Comments
 (0)