diff --git a/History.md b/History.md index b42ebbda57..9ca14e83d6 100644 --- a/History.md +++ b/History.md @@ -5,7 +5,7 @@ * Add pumactl `thread-backtraces` command to print thread backtraces (#2053) * Configuration: `environment` is read from `RAILS_ENV`, if `RACK_ENV` can't be found (#2022) * Do not set user_config to quiet by default to allow for file config (#2074) - * `GC.compact` is called before fork if available (#2093) + * `GC.compact` is called before fork if available (#2093), otherwise GC.start is called * Add `requests_count` to workers stats. (#2106) * Increases maximum URI path length from 2048 to 8196 bytes (#2167) * Force shutdown responses can be overridden by using the `lowlevel_error_handler` config (#2203) diff --git a/lib/puma/cluster.rb b/lib/puma/cluster.rb index 7a3d3f7fa7..d3e597fab7 100644 --- a/lib/puma/cluster.rb +++ b/lib/puma/cluster.rb @@ -459,7 +459,11 @@ def run @master_read, @worker_write = read, @wakeup @launcher.config.run_hooks :before_fork, nil, @launcher.events - GC.compact if GC.respond_to?(:compact) + if GC.respond_to?(:compact) + GC.compact + else + GC.start + end spawn_workers