diff options
| author | Michael Klishin <michael@novemberain.com> | 2017-07-20 17:53:03 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-20 17:53:03 +0300 |
| commit | 6cf6d4d91099c3a8c71356d8a485b1214fc48117 (patch) | |
| tree | 003e4664d6ff2dfee1107d7f0dc0a88f2780c3b6 /src | |
| parent | 1532037fec1291641d55f460046070902081b5e3 (diff) | |
| parent | 2cab2d9b9a6dd58a632a76a567acdc086052c374 (diff) | |
| download | rabbitmq-server-git-6cf6d4d91099c3a8c71356d8a485b1214fc48117.tar.gz | |
Merge pull request #1295 from rabbitmq/rabbitmq-server-1294rabbitmq_v3_6_11_milestone4
Report a difference between RSS and erlang total memory only if RSS is bigger.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_vm.erl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/rabbit_vm.erl b/src/rabbit_vm.erl index 74d29f5be4..685cea2ea7 100644 --- a/src/rabbit_vm.erl +++ b/src/rabbit_vm.erl @@ -51,16 +51,22 @@ memory() -> 0 end, MgmtDbETS = ets_memory([rabbit_mgmt_storage]), - OsTotal = vm_memory_monitor:get_process_memory(), + VMTotal = vm_memory_monitor:get_process_memory(), - [{processes, Processes}, + [{total, ErlangTotal}, + {processes, Processes}, {ets, ETS}, {atom, Atom}, {binary, Bin}, {code, Code}, {system, System}] = - erlang:memory([processes, ets, atom, binary, code, system]), + erlang:memory([total, processes, ets, atom, binary, code, system]), + + Unaccounted = case VMTotal - ErlangTotal of + GTZ when GTZ > 0 -> GTZ; + _LTZ -> 0 + end, OtherProc = Processes - ConnsReader - ConnsWriter - ConnsChannel - ConnsOther @@ -96,9 +102,9 @@ memory() -> %% System {code, Code}, {atom, Atom}, - {other_system, System - ETS - Bin - Code - Atom}, + {other_system, System - ETS - Bin - Code - Atom + Unaccounted}, - {total, OsTotal} + {total, VMTotal} ]. %% [1] - erlang:memory(processes) can be less than the sum of its %% parts. Rather than display something nonsensical, just silence any |
