diff options
author | Matthew Sackman <matthew@lshift.net> | 2009-10-29 17:39:56 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@lshift.net> | 2009-10-29 17:39:56 +0000 |
commit | 3b7176156fd02edc7f6296e876e908e922aeea22 (patch) | |
tree | 4fd1a8abfdc4bc59d81095f8dc4c453f9c1c2ea2 | |
parent | f25509f3cdca230dfd89358a6e2b88175f8cf2b6 (diff) | |
download | rabbitmq-server-bug21457.tar.gz |
set limits for 32bit to 4GB and 64bit to 256TB. Set default vm_memory_high_watermark to 0.4, and adjust display of memory size in undetected OS casebug21457
-rwxr-xr-x | scripts/rabbitmq-server | 2 | ||||
-rwxr-xr-x | scripts/rabbitmq-server.bat | 2 | ||||
-rwxr-xr-x | scripts/rabbitmq-service.bat | 2 | ||||
-rw-r--r-- | src/vm_memory_monitor.erl | 11 |
4 files changed, 9 insertions, 8 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 08ceb27d..34904850 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -109,7 +109,7 @@ exec erl \ -os_mon start_cpu_sup true \ -os_mon start_disksup false \ -os_mon start_memsup false \ - -os_mon vm_memory_high_watermark 0.7 \ + -os_mon vm_memory_high_watermark 0.4 \ -mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \ ${RABBITMQ_CLUSTER_CONFIG_OPTION} \ ${RABBITMQ_SERVER_START_ARGS} \ diff --git a/scripts/rabbitmq-server.bat b/scripts/rabbitmq-server.bat index 7cd3a33f..cf94d61c 100755 --- a/scripts/rabbitmq-server.bat +++ b/scripts/rabbitmq-server.bat @@ -138,7 +138,7 @@ if exist "%RABBITMQ_CONFIG_FILE%.config" ( -os_mon start_cpu_sup true ^
-os_mon start_disksup false ^
-os_mon start_memsup false ^
--os_mon vm_memory_high_watermark 0.7 ^
+-os_mon vm_memory_high_watermark 0.4 ^
-mnesia dir \""%RABBITMQ_MNESIA_DIR%"\" ^
%CLUSTER_CONFIG% ^
%RABBITMQ_SERVER_START_ARGS% ^
diff --git a/scripts/rabbitmq-service.bat b/scripts/rabbitmq-service.bat index f882da8a..6f9e525d 100755 --- a/scripts/rabbitmq-service.bat +++ b/scripts/rabbitmq-service.bat @@ -173,7 +173,7 @@ set ERLANG_SERVICE_ARGUMENTS= ^ -os_mon start_cpu_sup true ^
-os_mon start_disksup false ^
-os_mon start_memsup false ^
--os_mon vm_memory_high_watermark 0.7 ^
+-os_mon vm_memory_high_watermark 0.4 ^
-mnesia dir \""%RABBITMQ_MNESIA_DIR%"\" ^
%CLUSTER_CONFIG% ^
%RABBITMQ_SERVER_START_ARGS% ^
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl index d0aa1b7d..6da47933 100644 --- a/src/vm_memory_monitor.erl +++ b/src/vm_memory_monitor.erl @@ -95,9 +95,10 @@ init([MemFraction]) -> TotalMemory = case get_total_memory() of unknown -> - rabbit_log:warning("Unknown total memory size for your OS ~p. " - "Assuming memory size is ~p bytes.~n", - [os:type(), ?MEMORY_SIZE_FOR_UNKNOWN_OS]), + rabbit_log:warning( + "Unknown total memory size for your OS ~p. " + "Assuming memory size is ~pMB.~n", + [os:type(), trunc(?MEMORY_SIZE_FOR_UNKNOWN_OS/1048576)]), ?MEMORY_SIZE_FOR_UNKNOWN_OS; M -> M end, @@ -199,8 +200,8 @@ start_timer(Timeout) -> %% in big trouble anyway. get_vm_limit() -> case erlang:system_info(wordsize) of - 4 -> 2147483648; %% 2 GB for 32 bits 2^31 - 8 -> 140737488355328 %% 128 TB for 64 bits 2^47 + 4 -> 4294967296; %% 4 GB for 32 bits 2^32 + 8 -> 281474976710656 %% 256 TB for 64 bits 2^48 %% http://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details end. |