linux进程内存占用排序命令

页面导航:首页 > 操作系统 > LINUX > linux进程内存占用排序命令

linux进程内存占用排序命令

来源: 作者: 时间:2016-08-18 10:29 【

linux进程内存占用排序命令今天查看linux服务器,想查看各个进程的占用率,就使用:[[email protected] ~]$ topPID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND29613 build 15 0 158m 713...
linux进程内存占用排序命令
 
今天查看linux服务器,想查看各个进程的占用率,就使用:
 
[[email protected] ~]$ top
 
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29613 build 15 0 158m 7136 3720 S 2.0 0.1 0:00.27 svn
29609 build 15 0 158m 7132 3720 S 2.3 0.1 0:00.70 svn
29601 qhkf 15 0 12868 1260 820 R 0.3 0.0 0:00.09 top
29598 oracle 15 0 1935m 15m 13m S 0.0 0.2 0:00.00 oracle
29596 oracle 15 0 1936m 27m 24m S 0.0 0.3 0:00.03 oracle
29582 qhkf 15 0 102m 3420 2252 S 0.0 0.0 0:00.04 vim
29506 build 15 0 158m 7252 3724 S 2.3 0.1 0:03.76 svn
但是没有按照内存排序,然后查了下,按一下shift + f 就可以出现排序的列
 
Current Sort Field: N for window 1:Def
Select sort field via field letter, type any other key to return
 
  a: PID = Process Id shown due to screen width or your
  b: PPID = Parent Process Pid field order, the '<' and '>' keys
  c: RUSER = Real user name will be unavailable until a field
  d: UID = User Id within viewable range is chosen.
  e: USER = User Name
  f: GROUP = Group Name Note2:
  g: TTY = Controlling Tty Field sorting uses internal values,
  h: PR = Priority not those in column display. Thus,
  i: NI = Nice value the TTY & WCHAN fields will violate
  j: P = Last used cpu (SMP) strict ASCII collating sequence.
  k: %CPU = CPU usage (shame on you if WCHAN is chosen)
  l: TIME = CPU Time
  m: TIME+ = CPU Time, hundredths
* N: %MEM = Memory usage (RES)
  o: VIRT = Virtual Image (kb)
  p: SWAP = Swapped size (kb)
  q: RES = Resident size (kb)
  r: CODE = Code size (kb)
  s: DATA = Data+Stack size (kb)
  t: SHR = Shared Mem size (kb)
  u: nFLT = Page Fault count
  v: nDRT = Dirty Pages count
  w: S = Process Status
  x: COMMAND = Command name/line
  y: WCHAN = Sleeping in Function
  z: Flags = Task Flags <sched.h>
然后就可以选择自己喜欢的排序方式啦,例如选择N,看看那几个进程占用的内存大,接下来就可以分析啦
 
PID   USER   PR NI VIRT RES SHR   S %CPU%MEM TIME+  COMMAND
14101 oracle 15 0 1941m 613m 608m S 0.0 7.7 2:25.78 oracle
14095 oracle 15 0 1987m 521m 477m S 0.0 6.5 2:24.58 oracle
20477 oracle 15 0 1945m 483m 478m S 0.0 6.1 0:24.79 oracle
14522 oracle 15 0 1941m 427m 420m S 0.0 5.4 2:20.59 oracle
14105 oracle 15 0 1941m 268m 262m S 0.0 3.4 3:46.04 oracle
 
Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<