summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2017-06-08 00:59:54 +0300
committerMichael Klishin <mklishin@pivotal.io>2017-06-08 00:59:54 +0300
commitbca99be7e265528b8bdbc6b5c2c51c6e178bfda4 (patch)
treeca4342e829a66c478646fb12fbfea23cfdc59b1c
parent7bc2770983345eb110015f03244720be78c9ba64 (diff)
parentd6d9e9824c3284efb9fd9b166686dc0e84fe4451 (diff)
downloadrabbitmq-server-git-bca99be7e265528b8bdbc6b5c2c51c6e178bfda4.tar.gz
Merge branch 'stable' into rabbitmq-server-1243
-rw-r--r--docs/rabbitmq.config.example2
-rw-r--r--src/background_gc.erl2
-rw-r--r--src/vm_memory_monitor.erl21
3 files changed, 14 insertions, 11 deletions
diff --git a/docs/rabbitmq.config.example b/docs/rabbitmq.config.example
index 3eee836572..7acd6a4d5f 100644
--- a/docs/rabbitmq.config.example
+++ b/docs/rabbitmq.config.example
@@ -325,7 +325,7 @@
%% Whether or not to enable background GC.
%%
- %% {background_gc_enabled, true},
+ %% {background_gc_enabled, false},
%%
%% Interval (in milliseconds) at which we run background GC.
%%
diff --git a/src/background_gc.erl b/src/background_gc.erl
index 2ae9d93e4e..bbac3138cf 100644
--- a/src/background_gc.erl
+++ b/src/background_gc.erl
@@ -74,7 +74,7 @@ interval_gc(State = #state{last_interval = LastInterval}) ->
State#state{last_interval = Interval}.
gc() ->
- Enabled = rabbit_misc:get_env(rabbit, background_gc_enabled, true),
+ Enabled = rabbit_misc:get_env(rabbit, background_gc_enabled, false),
case Enabled of
true ->
[garbage_collect(P) || P <- processes(),
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl
index ba324d649e..71e9f36c46 100644
--- a/src/vm_memory_monitor.erl
+++ b/src/vm_memory_monitor.erl
@@ -43,7 +43,7 @@
-define(SERVER, ?MODULE).
-define(DEFAULT_MEMORY_CHECK_INTERVAL, 1000).
--define(ONE_MB, 1048576).
+-define(ONE_MiB, 1048576).
%% For an unknown OS, we assume that we have 1GB of memory. It'll be
%% wrong. Scale by vm_memory_high_watermark in configuration to get a
@@ -214,9 +214,10 @@ set_mem_limits(State, MemLimit) ->
memory_limit = undefined } ->
error_logger:warning_msg(
"Unknown total memory size for your OS ~p. "
- "Assuming memory size is ~pMB.~n",
+ "Assuming memory size is ~p MiB (~p bytes).~n",
[os:type(),
- trunc(?MEMORY_SIZE_FOR_UNKNOWN_OS/?ONE_MB)]);
+ trunc(?MEMORY_SIZE_FOR_UNKNOWN_OS/?ONE_MiB),
+ ?MEMORY_SIZE_FOR_UNKNOWN_OS]);
_ ->
ok
end,
@@ -227,18 +228,20 @@ set_mem_limits(State, MemLimit) ->
case get_vm_limit() of
Limit when Limit < TotalMemory ->
error_logger:warning_msg(
- "Only ~pMB of ~pMB memory usable due to "
+ "Only ~p MiB (~p bytes) of ~p MiB (~p bytes) memory usable due to "
"limited address space.~n"
"Crashes due to memory exhaustion are possible - see~n"
"http://www.rabbitmq.com/memory.html#address-space~n",
- [trunc(V/?ONE_MB) || V <- [Limit, TotalMemory]]),
+ [trunc(Limit/?ONE_MiB), Limit, trunc(TotalMemory/?ONE_MiB),
+ TotalMemory]),
Limit;
_ ->
TotalMemory
end,
MemLim = interpret_limit(parse_mem_limit(MemLimit), UsableMemory),
- error_logger:info_msg("Memory limit set to ~pMB of ~pMB total.~n",
- [trunc(MemLim/?ONE_MB), trunc(TotalMemory/?ONE_MB)]),
+ error_logger:info_msg("Memory limit set to ~p MiB (~p bytes) of ~p MiB (~p bytes) total.~n",
+ [trunc(MemLim/?ONE_MiB), MemLim, trunc(TotalMemory/?ONE_MiB),
+ TotalMemory]),
internal_update(State #state { total_memory = TotalMemory,
memory_limit = MemLim,
memory_config_limit = MemLimit}).
@@ -402,9 +405,9 @@ parse_line_sunos(Line) ->
[Value1 | UnitsRest] = string:tokens(RHS, " "),
Value2 = case UnitsRest of
["Gigabytes"] ->
- list_to_integer(Value1) * ?ONE_MB * 1024;
+ list_to_integer(Value1) * ?ONE_MiB * 1024;
["Megabytes"] ->
- list_to_integer(Value1) * ?ONE_MB;
+ list_to_integer(Value1) * ?ONE_MiB;
["Kilobytes"] ->
list_to_integer(Value1) * 1024;
_ ->