diff options
Diffstat (limited to 'src')
| -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 df5f73e749..c254c30d06 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 %%---------------------------------------------------------------------------- |
