summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-06-19 17:52:00 +0100
committerMatthew Sackman <matthew@lshift.net>2009-06-19 17:52:00 +0100
commitae6989591b7a6e430a4f4c6ec4e51ebb15377b38 (patch)
treee29ed0ad9a77be61703bc50a21bc29291907946d
parent6096fe52182b61165a5f36fe87c44730e645e2fa (diff)
downloadrabbitmq-server-git-ae6989591b7a6e430a4f4c6ec4e51ebb15377b38.tar.gz
Just added a means to get the ets:info out for the cache. Testing shows that it does seem to get emptied successfully.
So, using this revision, if you run: rabbitmq-java-client/build/dist$ sh runjava.sh com/rabbitmq/examples/MulticastMain -y 10 -r 50 -s 1048576 -m 100 -z 120 then over the two mins, I see beam take between about 30% and 45% of my memory, once it's up and running. Using the revision right after the API change, i.e. 9f0ee0399838, the same test tries to take between about 45% and 60% of my memory. Don't forget to run: rabbitmq-server$ ./scripts/rabbitmqctl reduce_memory_footprint rabbitmq-server$ ./scripts/rabbitmqctl reduce_memory_footprint before running the above test.
-rw-r--r--src/rabbit_disk_queue.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_disk_queue.erl b/src/rabbit_disk_queue.erl
index 329b453a4d..c8f726318e 100644
--- a/src/rabbit_disk_queue.erl
+++ b/src/rabbit_disk_queue.erl
@@ -44,7 +44,7 @@
dump_queue/1, delete_non_durable_queues/1, auto_ack_next_message/1
]).
--export([length/1]).
+-export([length/1, get_cache_info/0]).
-export([stop/0, stop_and_obliterate/0,
to_disk_only_mode/0, to_ram_disk_mode/0]).
@@ -263,6 +263,7 @@
-spec(to_ram_disk_mode/0 :: () -> 'ok').
-spec(to_disk_only_mode/0 :: () -> 'ok').
-spec(length/1 :: (queue_name()) -> non_neg_integer()).
+-spec(get_cache_info/0 :: () -> [{atom(), term()}]).
-endif.
@@ -333,6 +334,9 @@ to_ram_disk_mode() ->
length(Q) ->
gen_server2:call(?SERVER, {length, Q}, infinity).
+get_cache_info() ->
+ gen_server2:call(?SERVER, get_cache_info, infinity).
+
%% ---- GEN-SERVER INTERNAL API ----
init([FileSizeLimit, ReadFileHandlesLimit]) ->
@@ -473,7 +477,9 @@ handle_call({dump_queue, Q}, _From, State) ->
{reply, Result, State1};
handle_call({delete_non_durable_queues, DurableQueues}, _From, State) ->
{ok, State1} = internal_delete_non_durable_queues(DurableQueues, State),
- {reply, ok, State1}.
+ {reply, ok, State1};
+handle_call(get_cache_info, _From, State = #dqstate { message_cache = Cache }) ->
+ {reply, ets:info(Cache), State}.
handle_cast({publish, Q, Message}, State) ->
{ok, _MsgSeqId, State1} =