zoukankan      html  css  js  c++  java
  • Linux平台查看CPU、内存消耗降序的进程列表

    1.CPU占用最多的前10个进程

    ps auxw | head -1;ps auxw | sort -rn -k3 | head -10

    2.内存消耗最多的前10个进程

    ps auxw | head -1;ps auxw|sort -rn -k4 | head -10

    3.虚拟内存使用最多的前10个进程

    ps auxw | head -1;ps auxw | sort -rn -k5 | head -10

    4.其他命令及参数

    ps auxw –sort=rss
    ps auxw –sort=%cpu

    5.看看几个参数含义

    %MEM 进程的内存占用率
    MAJFL is the major page fault count,
    VSZ 进程所使用的虚存的大小
    RSS 进程使用的驻留集大小或者是实际内存的大小(RSS is the “resident set size” meaning physical memory used)
    TTY 与进程关联的终端(tty)

    串行端口终端(/dev/ttySn)
    伪终端(/dev/pty/)
    控制终端(/dev/tty)
    控制台终端(/dev/ttyn, /dev/console)
    虚拟终端(/dev/pts/n)

    STAT 检查的状态:进程状态使用字符表示的,如R(running正在运行或准备运行)、S(sleeping睡眠)、I(idle空闲)、Z (僵死)、D(不可中断的睡眠,通常是I/O)、P(等待交换页)、W(换出,表示当前页面不在内存)、N(低优先级任务)T(terminate终止)、W has no resident pages
    D不可中断 Uninterruptible sleep (usually IO)
    R正在运行,或在队列中的进程
    S处于休眠状态
    T停止或被追踪
    Z僵尸进程
    W进入内存交换(从内核2.6开始无效)
    X死掉的进程

    <高优先级
    N低优先级
    L有些页被锁进内存
    s包含子进程
    +位于后台的进程组;
    l多线程,克隆线程 multi-threaded (using CLONE_THREAD, like NPTL pthreads do)

  • 相关阅读:
    Spring Boot @DeleteMapping(转)
    白天和夜晚分类
    使用HSV色彩空间遮罩绿色区域
    HSV转换
    HSV 和 HLS颜色空间
    python 处理图像出现The lower bounary is neither an array of the same size and same type as src, nor a scalar in function inRange
    读取图片上一点的像素
    python 实现A*算法
    uda 4.C++面向对象编程
    uda 3.C++二维向量
  • 原文地址:https://www.cnblogs.com/rinack/p/14077710.html
Copyright © 2011-2022 走看看