File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ pub struct Meminfo {
204204 pub mem_available : bytesize:: ByteSize ,
205205 pub buffers : bytesize:: ByteSize ,
206206 pub cached : bytesize:: ByteSize ,
207+ pub s_reclaimable : bytesize:: ByteSize ,
207208 pub swap_cached : bytesize:: ByteSize ,
208209 pub active : bytesize:: ByteSize ,
209210 pub inactive : bytesize:: ByteSize ,
@@ -226,6 +227,8 @@ impl Meminfo {
226227 bytesize:: ByteSize :: from_str ( proc_map. get ( "MemAvailable" ) . unwrap ( ) ) . unwrap ( ) ;
227228 let buffers = bytesize:: ByteSize :: from_str ( proc_map. get ( "Buffers" ) . unwrap ( ) ) . unwrap ( ) ;
228229 let cached = bytesize:: ByteSize :: from_str ( proc_map. get ( "Cached" ) . unwrap ( ) ) . unwrap ( ) ;
230+ let s_reclaimable =
231+ bytesize:: ByteSize :: from_str ( proc_map. get ( "SReclaimable" ) . unwrap ( ) ) . unwrap ( ) ;
229232 let swap_cached =
230233 bytesize:: ByteSize :: from_str ( proc_map. get ( "SwapCached" ) . unwrap ( ) ) . unwrap ( ) ;
231234 let active = bytesize:: ByteSize :: from_str ( proc_map. get ( "Active" ) . unwrap ( ) ) . unwrap ( ) ;
@@ -238,6 +241,7 @@ impl Meminfo {
238241 mem_available,
239242 buffers,
240243 cached,
244+ s_reclaimable,
241245 swap_cached,
242246 active,
243247 inactive,
Original file line number Diff line number Diff line change @@ -354,7 +354,10 @@ fn get_memory_info(
354354 }
355355
356356 let buffer = with_unit ( memory_info. buffers . as_u64 ( ) , matches) ;
357- let cache = with_unit ( memory_info. cached . as_u64 ( ) , matches) ;
357+ let cache = with_unit (
358+ ( memory_info. cached + memory_info. s_reclaimable ) . as_u64 ( ) ,
359+ matches,
360+ ) ;
358361
359362 vec ! [
360363 ( len, format!( "{swap_used}" ) ) ,
You can’t perform that action at this time.
0 commit comments