summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2015-10-01 11:00:24 +0800
committerMichael Klishin <mklishin@pivotal.io>2015-10-01 11:00:24 +0800
commit18903957448df7a1889b49cb528bd6b81a7abbf5 (patch)
tree509ec5c02fedfc2f17e87af2b3222a39e07f860d
parentbd7cc49bc3fb418e783206d7015c3e327ed7a8f3 (diff)
parent6ce6cb3def0cf68e084562d2e9e009f37706b256 (diff)
downloadrabbitmq-server-git-18903957448df7a1889b49cb528bd6b81a7abbf5.tar.gz
Merge branch 'stable'
-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 8a8945114c..f76fcde83a 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -2008,19 +2008,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)};