查看那些进程使用了swap
https://blog.csdn.net/xiangliangyu/article/details/8213127
$ sudo pacman -S iotop
https://blog.longwin.com.tw/2017/02/linux-find-use-swap-process-2017/
單純使用到 swap 的 PID 列表可查 /proc/*/status 的 VmSwap 值
$ grep VmSwap /proc/*/status
查看那些进程使用了swap:
$ for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less
https://stackoverflow.com/questions/30481314/how-can-i-know-which-process-is-using-swap
https://stackoverflow.com/questions/479953/how-to-find-out-which-processes-are-using-swap-space-in-linux
查看那些进程使用了swap:(改进版)
$ (echo "COMM PID SWAP"; for file in /proc/*/status ; do awk '/^Pid|VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | grep kB | grep -wv "0 kB" | sort -k 3 -n -r) | column -t
https://www.cyberciti.biz/faq/linux-which-process-is-using-swap/
$ sudo pacman -S smem
$ smem
要查看面向库的视图,请输入:
# smem -m
要查看面向用户的视图,请输入:
$ sudo smem -u
[sudo] password for toma:
User Count Swap USS PSS RSS
rtkit 1 236 68 85 1356
dbus 1 296 804 878 2388
polkitd 1 4860 1956 1995 4400
root 14 26064 106560 127519 173776
toma 89 87412 3092876 3294633 7503088
$
要查看系统范围的内存使用情况摘要,请传递-w选项:
$ sudo smem -w
Area Used Cache Noncache
firmware/hardware 0 0 0
kernel image 0 0 0
kernel dynamic memory 4509624 4305388 204236
userspace memory 3424012 422456 3001556
free memory 225776 225776 0
$
查看系统视图
$ sudo smem -R 8G -K /path/to/vmlinux/on/disk -w
size: '/path/to/vmlinux/on/disk': No such file
Parameter '/path/to/vmlinux/on/disk' should be an original uncompressed compiled kernel file.
Area Used Cache Noncache
firmware/hardware 229196.0 0 229196.0
kernel image 0 0 0
kernel dynamic memory 4521572 4314964 206608
userspace memory 3448996 422668 3026328
free memory 188844 188844 0
$
要查看总计和百分比,请输入:
$ sudo smem -t -p
PID User Command Swap USS PSS RSS
518 toma /bin/sh /etc/xdg/xfce4/xini 0.01% 0.00% 0.00% 0.01%
753 toma /usr/lib/ibus/ibus-engine-s 0.01% 0.00% 0.00% 0.02%
......
106 5 1.42% 39.57% 42.28% 94.51%
# smem --help
-h, --help show this help message and exit
-H, --no-header disable header line 禁用标题行
-c COLUMNS, --columns=COLUMNS columns to show 要显示的列
-t, --totals show totals 显示总数
-a, --autosize size columns to fit terminal size
-R REALMEM, --realmem=REALMEM amount of physical RAM 物理RAM的数量
-K KERNEL, --kernel=KERNEL path to kernel image 内核映像的路径
-m, --mappings show mappings 显示映射
-u, --users show users 显示用户
-w, --system show whole system 显示整个系统
-P PROCESSFILTER, --processfilter=PROCESSFILTER process filter regex 进程过滤器正则表达式
-M MAPFILTER, --mapfilter=MAPFILTER map filter regex 地图过滤器正则表达式
-U USERFILTER, --userfilter=USERFILTER user filter regex 用户过滤器正则表达式
-n, --numeric numeric output 数字输出
-s SORT, --sort=SORT field to sort on 要排序的SORT字段
-r, --reverse reverse sort 反向排序
-p, --percent show percentage 显示百分比
-k, --abbreviate show unit suffixes 显示单位后缀k
--pie=PIE show pie graph 显示饼图
--bar=BAR show bar graph 显示条形图
-S SOURCE, --source=SOURCE /proc data source /proc数据源
查看那些进程使用了swap的更多相关文章
- Linux查看哪些进程用了Swap分区
如果系统的物理内存用光了,则会用到swap.系统就会跑得很慢,但仍能运行;如果Swap空间用光了,那么系统就会发生错误.通常会出现“application is out of memory”的错误,严 ...
- 【转】linux 查看哪些进程用了swap
转自:http://blog.csdn.net/xiangliangyu/article/details/8213127 如果系统的物理内存用光了,则会用到swap.系统就会跑得很慢,但仍能运行;如果 ...
- 查看哪些进程占用了SWAP分区?
在日常管理中,我们经常会遇到swap分区使用比较多,那么导致是那些进程使用的呢,其实我们可以通过/proc/pid/下的smaps来获得.使用下面的命令可以列出所有进程占用的swap分区的大小,分别我 ...
- 【linux】linux查看资源任务管理器,使用top命令 + 查看java进程下的线程数量【两种方式】
================================ 详解:https://blog.csdn.net/achenyuan/article/details/77867661 ======= ...
- linux查看某个进程的线程id(spid)
鉴于linux下线程的广泛使用 我们怎么查看某个进程拥有的线程id了 现在很多服务的设计 主进程->子进程->线程(比如mysql,varnish) 主进程负责侦听网络上的连接 并把连接发 ...
- Linux 查看 删除进程
这东西,时间久不用总容易忘....记下来! 1. 在 LINUX 命令平台输入 1-2 个字符后按 Tab 键会自动补全后面的部分(前提是要有这个东西,例如在装了 tomcat 的前提下, 输入 to ...
- 查看JAVA进程中哪个线程CPU消耗最高
一,在centos linux 上查看进程占用cpu过高 top shift+h 查看哪个进程程消耗最高 二,查看JAVA进程中哪个线程消耗最高 2.1 导出java运行的线程信息 ...
- linux 查看僵尸进程
top -b -i -n 1 查看僵死进程命令 ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' 查看apache 当前进程数 ps -ef | grep ht ...
- Windows下查看8080进程及结束进程命令
Windows下查看进程及结束进程命令 1)查看占用8080端口的进程号 >netstat –aon | findstr “8080” 结果:TCP 0.0.0.0:8080 ...
随机推荐
- git冲突解决的几种办法
文章目录 git stash 栈 放弃本地修改 撤销分支 强行冲掉之前的分支 删除分支 git stash 栈 git stash git pull git stash pop 当pull出现冲突时 ...
- iptables介绍
iptables防火墙可以用于创建过滤(filter)与NAT规则.所有Linux发行版都能使用iptables. iptables的结构:iptables-->Tables-->Chai ...
- 二叉树的简单操作(Binary Tree)
树形结构应该是贯穿整个数据结构的一个比较重要的一种结构,它的重要性不言而喻! 讲到树!一般都是讨论二叉树,而关于二叉树的定义以及概念这里不做陈诉,可自行搜索. 在C语言里面需要实现一个二叉树,我们需要 ...
- jquery.validate.js使用实例
一.常用方式: $('form').validate({ rules: {}, messages: { }, submitHandler: function () {}) ...
- ubuntu安装后问题
ubuntu安装后桌面显示不正常,出现闪屏,或者是缺图标的问题多数是ubuntu的3D加速显示问题 解决方法,vmware workstations 中的菜单栏:虚拟机->设置->显示器- ...
- WebApi--------找到了与该请求匹配的多个操作问题解决
错误信息: {"Message": "出现错误.","ExceptionMessage": "找到了与该请求匹配的多个操作: \r ...
- day 21 内存管理,正则
一.内存管理 1.垃圾回收 不能被程序访问到的数据,就称之为垃圾. 2.引用计数 引用计数是用来记录值得内存地址被记录的次数 每一次对值地址的引用都可以使得该值的引用计数+1 每一次对值地址的释放都可 ...
- Linux的.pid文件
PID全称是Process Identification. PID是进程的代号,每个进程有唯一的PID编号.它是进程运行时系统随机分配的,并不代表专门的进程.在运行时PID是不会改变标识符的,但是你终 ...
- javascript 飞机大战完整代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 石头的Xcode学习列表
http://www.cnblogs.com/JangoJing/tag/xcode/