首页 > 系统相关 >linux系统查找占用swap空间最多的10个进程

linux系统查找占用swap空间最多的10个进程

时间:2024-05-15 17:09:59浏览次数:22  
标签:10 vsz pid swap linux 进程

linux系统查找占用swap空间最多的10个进程
(1)ps -eo pid,user,comm,pmem,vsz --sort=-vsz | head -n 11
(2)for i in $(cd /proc;ls | grep "^[0-9]"|awk '$0 >100');do awk '/Swap:/{a=a+$2}END{print "'$i'", a/1024"M"}' /proc/$i/smaps 2>/dev/null;done | sort -k2nr | head -10
通过pid查看对应的服务
命令:netstat -nap | grep 进程pid
或 ps aux | grep pid 查看什么进程占用swap,通知业务清理

  • pid: 进程ID。
  • ppid: 父进程ID。
  • user: 进程所有者。
  • comm: 进程的命令名。
  • %mem: 进程的物理内存使用率。
  • %cpu: 进程的CPU使用率。
  • vsz: 进程的虚拟内存大小(以KB为单位)。
  • rss: 进程的驻留内存大小(以KB为单位)。
  • stime: 进程的启动时间。
  • etime: 进程的累计运行时间。

 (3)显示进程的PID、用户、命令名、物理内存使用率和虚拟内存大小

    ps -eo pid,user,comm,%mem,vsz

 

标签:10,vsz,pid,swap,linux,进程
From: https://www.cnblogs.com/libin-linux/p/18194279

相关文章

  • Linux - 内核版本升级
    测试时间:2024年5月15日,本文测试CentOS7.9的内核版本升级 一、使用第三方仓库(ELRepo)(1)升级前内核查看(3.10.0-1160.el7.x86_64):uname-a或者uname-r(2)添加ELRepo仓库yuminstall-yhttps://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm(3)检查可安装的内核......
  • linux下使用c++模拟下载进度
    #include<iostream>#include<iomanip>#include<chrono>#include<thread>voidshowProgressBar(doubleprogress){constintbarWidth=70;std::cout<<"\r[";intpos=static_cast<int>(barWid......
  • 108. 将有序数组转换为二叉搜索树(leetcode)
    https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/description/要点是分割左右区间,并且分割时需要注意left和right相加可能会超过int,但是本题不需要classSolution{publicTreeNodesortedArrayToBST(int[]nums){//有返回值写法......
  • index.js from Terser Error: error:0308010C:digital envelope routines::unsupporte
    Vue报错error:0308010C:digitalenveloperoutines::unsupported出现这个错误是因为node.jsV17版本中最近发布的OpenSSL3.0,而OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响.方法1.打开终端(按健win+R弹出窗口,键盘输入cmd,然后敲回车)并......
  • 【Linux命令学习】lsof查看打开的文件
    lsof:listopenfiles作用1:可查端口号被哪个进程占用比如我们跑自动化,经常会遇到端口号被占用,无法启动driverlsof-i:8081lsof输出的结果含义:fd:文件描述符的数字,通常是一个正整数。filedescriptortype:文件描述符的类型,如 REG 表示普通文件,DIR 表示目录,CHR 表示字......
  • FM20S用户手册--Linux系统启动卡制作及系统固化
     ......
  • Linux常用命令
    常用的linux命令:========================================================================================================================目录类/代表根目录.代表当前目录..代表上级目录cd/进入根目录cd..进入上级目录ls查看当前目录下的所有文件ll查看当前目录......
  • Linux远程连接
    Linuxcentos设置静态ip参考:https://blog.csdn.net/weixin_45533131/article/details/128002480FileZilla安装下载与使用参考:https://blog.csdn.net/Passerby_Wang/article/details/125298958FileZilla是免费开源的FTP软件,,分为客户端版本和服务器版本,具备所有的FTP软件功能,......
  • P1044 [NOIP2003 普及组] 栈
    链接:https://www.luogu.com.cn/problem/P1044两种很好的思路:代码:#include<iostream>#include<vector>#include<algorithm>#include<math.h>#include<sstream>#include<string>#include<string.h>#include<iomanip>#incl......
  • C. Swap Game
    原题链接题解突破口:我要让bob早点没得减,我肯定选最小的那个code#include<bits/stdc++.h>usingnamespacestd;intmain(){intt;cin>>t;while(t--){intn;cin>>n;intx;cin>>x;intflag=0;......