Skip to content

forces GC after queue paging #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions src/rabbit_variable_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand Down