summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-06-18 17:45:13 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-06-18 17:45:13 +0100
commit9a9905e0b90124b92e0afc474b69c9a9fbfc2ea2 (patch)
tree51363fce068ecccb2f663b806ceaf8d23c43c0f8
parentbfc817b58e3883f15e586d426bce33a1d209bb10 (diff)
downloadrabbitmq-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.erl6
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;