summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2017-11-01 05:45:04 +0300
committerGitHub <noreply@github.com>2017-11-01 05:45:04 +0300
commit27bf1d6869cba44122e595655a5c0d612152a3f4 (patch)
treeea34ac8756c07f823b82964c99f9920259efda41
parente1c92ec363a17746199773e6e9a22a323ccb6c7e (diff)
parent627339a62e0c063ed07afe347c19c08ff24253fc (diff)
downloadrabbitmq-server-git-27bf1d6869cba44122e595655a5c0d612152a3f4.tar.gz
Merge pull request #1414 from rabbitmq/rabbitmq-management-499-followup
Report strategy, erlang total, rss and allocated memory
-rw-r--r--src/rabbit_vm.erl19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/rabbit_vm.erl b/src/rabbit_vm.erl
index b2474a6b38..265bcb45e3 100644
--- a/src/rabbit_vm.erl
+++ b/src/rabbit_vm.erl
@@ -61,19 +61,11 @@ memory() ->
erlang:memory([total, processes, ets, atom, binary, code, system]),
Strategy = vm_memory_monitor:get_memory_calculation_strategy(),
- {Allocated, VMTotal} = case Strategy of
- erlang -> {ErlangTotal, ErlangTotal};
- allocated ->
- Alloc = recon_alloc:memory(allocated),
- {Alloc, Alloc};
- rss ->
- Alloc = recon_alloc:memory(allocated),
- Vm = vm_memory_monitor:get_process_memory(current),
- {Alloc, Vm}
- end,
+ Allocated = recon_alloc:memory(allocated),
+ Rss = vm_memory_monitor:get_rss_memory(),
AllocatedUnused = max(Allocated - ErlangTotal, 0),
- OSReserved = max(VMTotal - Allocated, 0),
+ OSReserved = max(Rss - Allocated, 0),
OtherProc = Processes
- ConnsReader - ConnsWriter - ConnsChannel - ConnsOther
@@ -112,7 +104,10 @@ memory() ->
{other_system, System - ETS - Bin - Code - Atom},
{allocated_unused, AllocatedUnused},
{reserved_unallocated, OSReserved},
- {total, VMTotal}
+ {strategy, Strategy},
+ {total, [{erlang, ErlangTotal},
+ {rss, Rss},
+ {allocated, Allocated}]}
].
%% [1] - erlang:memory(processes) can be less than the sum of its
%% parts. Rather than display something nonsensical, just silence any