@@ -1947,19 +1947,23 @@ reduce_memory_use(State = #vqstate {
1947
1947
State2
1948
1948
end ,
1949
1949
1950
- case chunk_size (? QUEUE :len (Q2 ) + ? QUEUE :len (Q3 ),
1951
- permitted_beta_count (State1 )) of
1952
- S2 when S2 >= IoBatchSize ->
1953
- % % There is an implicit, but subtle, upper bound here. We
1954
- % % may shuffle a lot of messages from Q2/3 into delta, but
1955
- % % the number of these that require any disk operation,
1956
- % % namely index writing, i.e. messages that are genuine
1957
- % % betas and not gammas, is bounded by the credit_flow
1958
- % % limiting of the alpha->beta conversion above.
1959
- push_betas_to_deltas (S2 , State1 );
1960
- _ ->
1961
- State1
1962
- end .
1950
+ State3 =
1951
+ case chunk_size (? QUEUE :len (Q2 ) + ? QUEUE :len (Q3 ),
1952
+ permitted_beta_count (State1 )) of
1953
+ S2 when S2 >= IoBatchSize ->
1954
+ % % There is an implicit, but subtle, upper bound here. We
1955
+ % % may shuffle a lot of messages from Q2/3 into delta, but
1956
+ % % the number of these that require any disk operation,
1957
+ % % namely index writing, i.e. messages that are genuine
1958
+ % % betas and not gammas, is bounded by the credit_flow
1959
+ % % limiting of the alpha->beta conversion above.
1960
+ push_betas_to_deltas (S2 , State1 );
1961
+ _ ->
1962
+ State1
1963
+ end ,
1964
+ % % See rabbitmq-server-290 for the reasons behind this GC call.
1965
+ garbage_collect (),
1966
+ State3 .
1963
1967
1964
1968
limit_ram_acks (0 , State ) ->
1965
1969
{0 , ui (State )};
0 commit comments