How does top get the shared memory of a process in linux?

I just looked it up briefly, and I think I got it from some files under the / proc directory. I"ve seen that the most possible / proc/pid/status file doesn"t have shared memory, so I guess it was obtained through some kind of calculation, asking for advice.

clipboard.png

Mar.04,2021

read from the proc/ file, you can also write a tool to read.
the / proc file system is a very important file system in linux. You can get almost all the running information from him.


answer it yourself. After checking the source code of top, it is found that it is / proc/pid/statm file

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34ff6-2bf70.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34ff6-2bf70.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?