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 | 46f9be1cf381d93f335b9841bd9fac24048b817a (patch) | |
tree | ef2283704f61b5474760aa4470555ed956fde310 | |
parent | 271b083cc309bc300448ca1e2d5aa7fca8a8497f (diff) | |
download | rabbitmq-server-46f9be1cf381d93f335b9841bd9fac24048b817a.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.
-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 0f6bca91..dee24cd9 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}, |