summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2009-09-23 11:43:59 +0100
committerMatthias Radestock <matthias@lshift.net>2009-09-23 11:43:59 +0100
commit49b6351e1b2c0733eb3313513d1009e207acfbee (patch)
tree24ee1133743fa50ec77d9d9ed618a807157a13e0
parenta3e0f937bf85c5979e5883216e4be4a441e503ed (diff)
downloadrabbitmq-server-git-49b6351e1b2c0733eb3313513d1009e207acfbee.tar.gz
get rid of message cache limit
limiting the size of the message cache is pointless. Firstly, the ets memory info does not include binaries. Secondly, the cache is only holding onto messages which current queue processes are holding onto, so we are not actually leaking any memory, and the only cost is the cost of the cache entries themselves, which should be small.
-rw-r--r--src/rabbit_msg_store.erl12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index 5b7afb6cb0..f9d27e122a 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -62,9 +62,7 @@
-define(FILE_EXTENSION, ".rdq").
-define(FILE_EXTENSION_TMP, ".rdt").
-define(FILE_EXTENSION_DETS, ".dets").
-
-define(CACHE_ETS_NAME, rabbit_disk_queue_cache).
--define(CACHE_MAX_SIZE, 10485760).
-define(BINARY_MODE, [raw, binary]).
-define(READ_MODE, [read, read_ahead]).
@@ -515,14 +513,8 @@ decrement_cache(MsgId, #msstate { message_cache = Cache }) ->
ok.
insert_into_cache(MsgId, Msg, #msstate { message_cache = Cache }) ->
- case cache_is_full(Cache) of
- true -> ok;
- false -> true = ets:insert_new(Cache, {MsgId, Msg, 1}),
- ok
- end.
-
-cache_is_full(Cache) ->
- ets:info(Cache, memory) > ?CACHE_MAX_SIZE.
+ true = ets:insert_new(Cache, {MsgId, Msg, 1}),
+ ok.
%%----------------------------------------------------------------------------
%% index