summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-11-17 18:19:19 +0000
committerMatthew Sackman <matthew@lshift.net>2009-11-17 18:19:19 +0000
commit5d165153c209a7d6f52a5db67e0082a5110ca4d3 (patch)
tree7ae7c9966e30daa31e7121d9327992e7ed3c7abe
parente00350fa28b02f253f0a04a3524ae5c53d83978b (diff)
downloadrabbitmq-server-git-5d165153c209a7d6f52a5db67e0082a5110ca4d3.tar.gz
truncate desired duration as I've now seen rounding issues cause behavioural problems
-rw-r--r--src/rabbit_memory_monitor.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl
index 0b6ad5c78a..99becb57da 100644
--- a/src/rabbit_memory_monitor.erl
+++ b/src/rabbit_memory_monitor.erl
@@ -241,7 +241,7 @@ internal_update(State = #state{memory_limit = Limit,
DesiredDurationAvg1 =
case AvgDuration == infinity orelse MemoryRatio > 2 of
true -> infinity;
- false -> lists:max([0, AvgDuration * MemoryRatio])
+ false -> lists:max([0, trunc(AvgDuration * MemoryRatio)])
end,
State1 = State#state{memory_ratio = MemoryRatio,
desired_duration = DesiredDurationAvg1},