Only shut down the current process when the memory limit is reached
Contrary to what the ruby documentation says, sending a signal to PID 0 actually signals the whole process group, not just the current process. So use Process.pid to make sure we only signal the current process.
This commit is contained in:
parent
a998a0bb20
commit
a491174efa
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ if defined?(SOFT_MEMORY_LIMIT) and defined?(PhusionPassenger)
|
|||
|
||||
# Restart if we've hit our memory limit
|
||||
if resident_size > SOFT_MEMORY_LIMIT
|
||||
Process.kill("USR1", 0)
|
||||
Process.kill("USR1", Process.pid)
|
||||
end
|
||||
|
||||
# Return the result of this request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue