@@ -61,19 +61,11 @@ memory() ->
6161 erlang :memory ([total , processes , ets , atom , binary , code , system ]),
6262
6363 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 (),
7466
7567 AllocatedUnused = max (Allocated - ErlangTotal , 0 ),
76- OSReserved = max (VMTotal - Allocated , 0 ),
68+ OSReserved = max (Rss - Allocated , 0 ),
7769
7870 OtherProc = Processes
7971 - ConnsReader - ConnsWriter - ConnsChannel - ConnsOther
@@ -112,7 +104,10 @@ memory() ->
112104 {other_system , System - ETS - Bin - Code - Atom },
113105 {allocated_unused , AllocatedUnused },
114106 {reserved_unallocated , OSReserved },
115- {total , VMTotal }
107+ {strategy , Strategy },
108+ {total , [{erlang , ErlangTotal },
109+ {rss , Rss },
110+ {allocated , Allocated }]}
116111 ].
117112% % [1] - erlang:memory(processes) can be less than the sum of its
118113% % parts. Rather than display something nonsensical, just silence any
0 commit comments