diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2015-10-01 11:00:24 +0800 |
|---|---|---|
| committer | Michael Klishin <mklishin@pivotal.io> | 2015-10-01 11:00:24 +0800 |
| commit | 18903957448df7a1889b49cb528bd6b81a7abbf5 (patch) | |
| tree | 509ec5c02fedfc2f17e87af2b3222a39e07f860d | |
| parent | bd7cc49bc3fb418e783206d7015c3e327ed7a8f3 (diff) | |
| parent | 6ce6cb3def0cf68e084562d2e9e009f37706b256 (diff) | |
| download | rabbitmq-server-git-18903957448df7a1889b49cb528bd6b81a7abbf5.tar.gz | |
Merge branch 'stable'
| -rw-r--r-- | src/rabbit_variable_queue.erl | 30 |
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)}; |
