- module OSM
- class MemoryLimit
- def initialize(app)
- @app = app
- end
-
- def call(env)
- # Process this requst
- status, headers, body = @app.call(env)
-
- # Restart if we've hit our memory limit
- if resident_size > APP_CONFIG['soft_memory_limit']
- Process.kill("USR1", 0)
- end
-
- # Return the result of this request
- [status, headers, body]
+ class MemoryLimit
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ # Process this requst
+ status, headers, body = @app.call(env)
+
+ # Restart if we've hit our memory limit
+ if resident_size > SOFT_MEMORY_LIMIT
+ Process.kill("USR1", 0)