Deep understanding of Linux View process memory usage _linux

Source: Internet
Author: User

Dynamically view memory usage for a process

Copy Code code as follows:

1. Top command
top-d 1-p pid [, pid ...]//set to delay 1s, default is delay 3s
If you want to sort by memory usage, you can shift + m (sort by memory usage)

Static view of memory usage for a process
Copy Code code as follows:

1, Pmap command
Pmap PID

2. PS command
PS Aux|grep process_name

3, view the status file under the/proc/process_id/folder
name:php
State:r (running)
sleepavg:0%
tgid:21574
pid:21574
ppid:10005
tracerpid:0
uid:1000 1000 1000 1000
GID:100 100 100 100
fdsize:256
Groups:16 100
vmpeak:161740 KB
vmsize:161740 KB
vmlck:0 KB
vmhwm:107144 KB
vmrss:107144 KB
vmdata:106192 KB
vmstk:84 KB
vmexe:5588 KB
vmlib:7884 KB
vmpte:268 KB
Threads:1
sigq:0/69632
sigpnd:0000000000000000
shdpnd:0000000000000000
sigblk:0000000000000000
sigign:0000000000001000
Sigcgt:00000001818040a7
capinh:0000000000000000
capprm:0000000000000000
capeff:0000000000000000
cpus_allowed:00000000,00000000,00000000,0000000f
Mems_allowed:1

The size of the task virtual address space Vmsize
The size of the physical memory the application is using Vmrss


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.