diff options
| author | Matthias Radestock <matthias@lshift.net> | 2008-10-25 06:13:06 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2008-10-25 06:13:06 +0100 |
| commit | 7700cc6e4bf0251b3d7b4fc354200a496a46efd3 (patch) | |
| tree | ef2283704f61b5474760aa4470555ed956fde310 /src | |
| parent | d7343c5d7fd97dad9d1ef75548714f9114ddbe42 (diff) | |
| download | rabbitmq-server-git-7700cc6e4bf0251b3d7b4fc354200a496a46efd3.tar.gz | |
hibernate writers
With this in place I am finally unable to make rabbit grind to a halt
due to garbage being held by idle processes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_writer.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rabbit_writer.erl b/src/rabbit_writer.erl index 0f6bca91bc..dee24cd99b 100644 --- a/src/rabbit_writer.erl +++ b/src/rabbit_writer.erl @@ -36,6 +36,8 @@ -record(wstate, {sock, channel, frame_max}). +-define(HIBERNATE_AFTER, 5000). + %%---------------------------------------------------------------------------- -ifdef(use_specs). @@ -63,6 +65,8 @@ start(Sock, Channel, FrameMax) -> mainloop(State) -> receive Message -> ?MODULE:mainloop(handle_message(Message, State)) + after ?HIBERNATE_AFTER -> + erlang:hibernate(?MODULE, mainloop, [State]) end. handle_message({send_command, MethodRecord}, |
