smem介绍
smem 是一个用于 分析 Linux 系统内存使用情况 的命令行工具,它比传统工具(如 ps, top, free 等)提供更精确且合理的内存分布视图,尤其是对于共享内存的处理。
在 Linux 下,多个进程可能共享同一段内存(比如共享库)。传统的 ps aux 或 top 工具仅统计 RSS(常驻内存集),会把共享内存重复统计,容易误判谁用内存最多。
而 smem 提供了更真实的:
| 指标 | 说明 |
|---|---|
| USS(Unique Set Size) | 当前进程独占使用的物理内存。 |
| PSS(Proportional Set Size) | 当前进程使用的物理内存,加上共享内存的“平均分摊”。这是判断谁真正“占内存”的最好指标。 |
| RSS(Resident Set Size) | 当前进程加载的所有物理内存,不管是不是共享的。传统 ps 就是看这个。 |
安装smem
CentOS / RHEL:yum install -y smem
Ubuntu / Debian:apt install -y smem
如果源内没有包那么可以直接下载可执行文件
wget https://data.baihuli.cn/files/smem-1.6.tar.gz
tar -zxvf smem-1.6.tar.gz
cp ./smem-1.6/smem /usr/local/bin
常用命令示例
显示每个进程的内存占用(按 PSS 排序):smem -r | sort -k4 -n
显示 USS、PSS、RSS,以 MB 为单位:smem -m
显示带有进程名的详细信息:smem -r -k -c “pid user name rss pss uss”
汇总统计(按用户):smem -u
汇总统计(按命令):smem -p
按进程统计PID | User | Command | Swap | USS | PSS | RSS:smem 默认单位是KB
按 PSS(最真实的内存占用)排序:smem -r -k
I was skeptical about Hann until I tried hann game. The GCash integration and fair RNG made me realize this platform truly understands Filipino players, turning my doubt into genuine excitement for their live dealer experience.
Great article! Secure accounts are key, especially with quick sign-ups like I’ve seen on platforms like cardtime app. Easy PHP deposits are a huge plus for Filipino players too! 👍
Hmm, the security layers mentioned are interesting, but I’m cautious. Always double-check platform legitimacy before trusting it with funds. For a safer look, check out Earn Php online casino first. Keep it real!