diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-06-18 17:45:13 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-06-18 17:45:13 +0100 |
commit | 9a9905e0b90124b92e0afc474b69c9a9fbfc2ea2 (patch) | |
tree | 51363fce068ecccb2f663b806ceaf8d23c43c0f8 | |
parent | bfc817b58e3883f15e586d426bce33a1d209bb10 (diff) | |
download | rabbitmq-server-bug25597.tar.gz |
Oops, I forgot that going back to vm_memory_monitor:get_memory_limit() means we can now have a limit of 0.0.bug25597
-rw-r--r-- | src/rabbit_memory_monitor.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl index d47b6e30..a9339074 100644 --- a/src/rabbit_memory_monitor.erl +++ b/src/rabbit_memory_monitor.erl @@ -198,7 +198,11 @@ internal_update(State = #state { queue_durations = Durations, queue_duration_count = Count }) -> {ok, LimitThreshold} = application:get_env(rabbit, vm_memory_high_watermark_paging_ratio), - MemoryRatio = erlang:memory(total) / vm_memory_monitor:get_memory_limit(), + MemoryLimit = vm_memory_monitor:get_memory_limit(), + MemoryRatio = case MemoryLimit > 0.0 of + true -> erlang:memory(total) / MemoryLimit; + false -> infinity + end, DesiredDurationAvg1 = if MemoryRatio =:= infinity -> 0.0; |