diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2013-06-07 13:46:39 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2013-06-07 13:46:39 +0100 |
| commit | cd4b0d8276cb1ce29d0f323f0c093ae87d8b43af (patch) | |
| tree | 906a524ab90b1fb63a451acf6860ba399970cd84 /src | |
| parent | a39b555ef73b1cda4e8dd5583f3f26362e71f1bc (diff) | |
| download | rabbitmq-server-git-cd4b0d8276cb1ce29d0f323f0c093ae87d8b43af.tar.gz | |
Remove redundant workaround.
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm_memory_monitor.erl | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl index f70156b66c..f281c16c46 100644 --- a/src/vm_memory_monitor.erl +++ b/src/vm_memory_monitor.erl @@ -263,29 +263,11 @@ get_total_memory({unix,openbsd}) -> sysctl("hw.usermem"); get_total_memory({win32,_OSname}) -> - %% Due to the Erlang print format bug, on Windows boxes the memory - %% size is broken. For example Windows 7 64 bit with 4Gigs of RAM - %% we get negative memory size: - %% > os_mon_sysinfo:get_mem_info(). - %% ["76 -1658880 1016913920 -1 -1021628416 2147352576 2134794240\n"] - %% Due to this bug, we don't actually know anything. Even if the - %% number is postive we can't be sure if it's correct. This only - %% affects us on os_mon versions prior to 2.2.1. - case application:get_key(os_mon, vsn) of - undefined -> - unknown; - {ok, Version} -> - case rabbit_misc:version_compare(Version, "2.2.1", lt) of - true -> %% os_mon is < 2.2.1, so we know nothing - unknown; - false -> - [Result|_] = os_mon_sysinfo:get_mem_info(), - {ok, [_MemLoad, TotPhys, _AvailPhys, - _TotPage, _AvailPage, _TotV, _AvailV], _RestStr} = - io_lib:fread("~d~d~d~d~d~d~d", Result), - TotPhys - end - end; + [Result|_] = os_mon_sysinfo:get_mem_info(), + {ok, [_MemLoad, TotPhys, _AvailPhys, _TotPage, _AvailPage, _TotV, _AvailV], + _RestStr} = + io_lib:fread("~d~d~d~d~d~d~d", Result), + TotPhys; get_total_memory({unix, linux}) -> File = read_proc_file("/proc/meminfo"), |
