@@ -61,19 +61,11 @@ memory() ->
61
61
erlang :memory ([total , processes , ets , atom , binary , code , system ]),
62
62
63
63
Strategy = vm_memory_monitor :get_memory_calculation_strategy (),
64
- {Allocated , VMTotal } = case Strategy of
65
- erlang -> {ErlangTotal , ErlangTotal };
66
- allocated ->
67
- Alloc = recon_alloc :memory (allocated ),
68
- {Alloc , Alloc };
69
- rss ->
70
- Alloc = recon_alloc :memory (allocated ),
71
- Vm = vm_memory_monitor :get_process_memory (current ),
72
- {Alloc , Vm }
73
- end ,
64
+ Allocated = recon_alloc :memory (allocated ),
65
+ Rss = vm_memory_monitor :get_rss_memory (),
74
66
75
67
AllocatedUnused = max (Allocated - ErlangTotal , 0 ),
76
- OSReserved = max (VMTotal - Allocated , 0 ),
68
+ OSReserved = max (Rss - Allocated , 0 ),
77
69
78
70
OtherProc = Processes
79
71
- ConnsReader - ConnsWriter - ConnsChannel - ConnsOther
@@ -112,7 +104,10 @@ memory() ->
112
104
{other_system , System - ETS - Bin - Code - Atom },
113
105
{allocated_unused , AllocatedUnused },
114
106
{reserved_unallocated , OSReserved },
115
- {total , VMTotal }
107
+ {strategy , Strategy },
108
+ {total , [{erlang , ErlangTotal },
109
+ {rss , Rss },
110
+ {allocated , Allocated }]}
116
111
].
117
112
% % [1] - erlang:memory(processes) can be less than the sum of its
118
113
% % parts. Rather than display something nonsensical, just silence any
0 commit comments