diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-02 23:36:53 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-02 23:36:53 +0100 |
commit | 3a4a2f1a6166a8b70c6086716a29a665bf6b4e5e (patch) | |
tree | e68b8dd541b603b3681ba4b7e6336f05d34b8662 | |
parent | 85f6c956cae3e063764fee10565502454f30b188 (diff) | |
download | rabbitmq-server-3a4a2f1a6166a8b70c6086716a29a665bf6b4e5e.tar.gz |
inlining refactor
-rw-r--r-- | src/vm_memory_monitor.erl | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl index df5f73e7..c254c30d 100644 --- a/src/vm_memory_monitor.erl +++ b/src/vm_memory_monitor.erl @@ -179,7 +179,7 @@ set_mem_limits(State, MemFraction) -> ?MEMORY_SIZE_FOR_UNKNOWN_OS; M -> M end, - MemLim = get_mem_limit(MemFraction, TotalMemory), + MemLim = trunc(MemFraction * lists:min([TotalMemory, get_vm_limit()])), error_logger:info_msg("Memory limit set to ~pMB of ~pMB total.~n", [trunc(MemLim/?ONE_MB), trunc(TotalMemory/?ONE_MB)]), internal_update(State #state { total_memory = TotalMemory, @@ -229,10 +229,6 @@ get_vm_limit(_OsType) -> %%http://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details end. -get_mem_limit(MemFraction, TotalMemory) -> - AvMem = lists:min([TotalMemory, get_vm_limit()]), - trunc(AvMem * MemFraction). - %%---------------------------------------------------------------------------- %% Internal Helpers %%---------------------------------------------------------------------------- |