diagnostics: support cgroup limit memory
close tikv/tikv#13217, ref tikv/tikv#13217
support cgroup limit memory in diagnostics service
@@ -350,7 +350,7 @@ fn mem_hardware_info(collector: &mut Vec<ServerInfoItem>) {
system.refresh_memory();
let mut pair = ServerInfoPair::default();
pair.set_key("capacity".to_string());
- pair.set_value((system.get_total_memory() * KIB).to_string());
+ pair.set_value(SysQuota::memory_limit_in_bytes().to_string());
let mut item = ServerInfoItem::default();
item.set_tp("memory".to_string());
item.set_name("memory".to_string());
