summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Videla <videlalvaro@gmail.com>2015-09-30 21:13:17 +0200
committerAlvaro Videla <videlalvaro@gmail.com>2015-09-30 21:13:17 +0200
commit6c390df864567d26aeb84a2d1be2ec162249991e (patch)
tree14d99f44135d179018ff35fb34050319b1c940a8 /src
parent31a4b251e4ce303458031d09f29730a8c27aff6d (diff)
downloadrabbitmq-server-git-6c390df864567d26aeb84a2d1be2ec162249991e.tar.gz
forces GC after queue paging
See malingin list discussion linked in #290 Fixes #290
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index f50c1bde7e..d970d6ed4f 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -1947,19 +1947,23 @@ reduce_memory_use(State = #vqstate {
State2
end,
- case chunk_size(?QUEUE:len(Q2) + ?QUEUE:len(Q3),
- permitted_beta_count(State1)) of
- S2 when S2 >= IoBatchSize ->
- %% There is an implicit, but subtle, upper bound here. We
- %% may shuffle a lot of messages from Q2/3 into delta, but
- %% the number of these that require any disk operation,
- %% namely index writing, i.e. messages that are genuine
- %% betas and not gammas, is bounded by the credit_flow
- %% limiting of the alpha->beta conversion above.
- push_betas_to_deltas(S2, State1);
- _ ->
- State1
- end.
+ State3 =
+ case chunk_size(?QUEUE:len(Q2) + ?QUEUE:len(Q3),
+ permitted_beta_count(State1)) of
+ S2 when S2 >= IoBatchSize ->
+ %% There is an implicit, but subtle, upper bound here. We
+ %% may shuffle a lot of messages from Q2/3 into delta, but
+ %% the number of these that require any disk operation,
+ %% namely index writing, i.e. messages that are genuine
+ %% betas and not gammas, is bounded by the credit_flow
+ %% limiting of the alpha->beta conversion above.
+ push_betas_to_deltas(S2, State1);
+ _ ->
+ State1
+ end,
+ %% See rabbitmq-server-290 for the reasons behind this GC call.
+ garbage_collect(),
+ State3.
limit_ram_acks(0, State) ->
{0, ui(State)};