How can I obtain information of the memory usage with Rust?


#1

Just like infomation below:

~$ cat /proc/meminfo
MemTotal:        6051304 kB
MemFree:          452540 kB
...

Is there any std modules?


#2

Do you want to know the memory usage of a single Rust program, or the total memory usage of the system?


#3

The whole system.


#4

You can get this info using the sys-info crate.


#5

Many thanks,:evergreen_tree: