diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-11-12 16:55:09 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-11-12 16:55:09 +0000 |
| commit | 294ce06ff9a351e5a1ab2e7c3f004de5dba10eef (patch) | |
| tree | 1ebb6eb7b79f9df8db322a2276fdfd74bd0ca113 /src | |
| parent | e14960e373df720bff1ec9fc3d90533b1bf6de4b (diff) | |
| download | rabbitmq-server-git-294ce06ff9a351e5a1ab2e7c3f004de5dba10eef.tar.gz | |
Don't hibernate, GC self instead.
Diffstat (limited to 'src')
| -rw-r--r-- | src/background_gc.erl | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/background_gc.erl b/src/background_gc.erl index d781a29082..0275700f67 100644 --- a/src/background_gc.erl +++ b/src/background_gc.erl @@ -23,9 +23,6 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). --define(HIBERNATE_AFTER_MIN, 1000). --define(DESIRED_HIBERNATE, 10000). - -define(MAX_RATIO, 0.01). -define(IDEAL_INTERVAL, 60000). @@ -52,15 +49,14 @@ run() -> %%---------------------------------------------------------------------------- init([]) -> - {ok, run_gc(#state{last_interval = ?IDEAL_INTERVAL}), hibernate, - {backoff, ?HIBERNATE_AFTER_MIN, ?HIBERNATE_AFTER_MIN, ?DESIRED_HIBERNATE}}. + {ok, run_gc(#state{last_interval = ?IDEAL_INTERVAL})}. handle_call(Msg, _From, State) -> {stop, {unexpected_call, Msg}, {unexpected_call, Msg}, State}. handle_cast(run, State) -> do_gc(), - {noreply, State, hibernate}; + {noreply, State}; handle_cast(Msg, State) -> {stop, {unexpected_cast, Msg}, State}. @@ -88,4 +84,5 @@ run_gc(State = #state{last_interval = LastInterval}) -> do_gc() -> [garbage_collect(P) || P <- processes(), {status, waiting} == process_info(P, status)], + garbage_collect(self()), %% Since we will never be waiting... ok. |
