文档章节

查看进程占用的内存

hncscwc
 hncscwc
发布于 2016/10/26 19:54
字数 3290
阅读 99
收藏 0

 1. top

Tasks: 264 total,   1 running, 263 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  1.4%sy,  1.4%ni, 96.7%id,  0.1%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   8062796k total,  7543940k used,   518856k free,   177216k buffers
Swap:        0k total,        0k used,        0k free,  5994368k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
24027 root      20   0 2950m  62m 3492 S    2  0.8   0:03.85 nginx
    1 root      20   0  1716  136   64 S    0  0.0   0:05.07 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.02 kthreadd
    3 root      20   0     0    0    0 S    0  0.0   0:02.04 ksoftirqd/0
    5 root       0 -20     0    0    0 S    0  0.0   0:00.00 kworker/0:0H
    7 root       0 -20     0    0    0 S    0  0.0   0:00.00 kworker/u:0H
    8 root      RT   0     0    0    0 S    0  0.0   0:03.51 migration/0
    9 root      20   0     0    0    0 S    0  0.0   0:00.00 rcu_bh
   10 root      20   0     0    0    0 S    0  0.0   1:05.15 rcu_sched
   11 root      20   0     0    0    0 S    0  0.0   0:00.90 ksoftirqd/1

Mem/total:  物理内存总的大小

Mem/used: 物理内存已使用的大小

Mem/free:   物理内存空闲的大小

Mem/buffers: 物理内存缓冲的大小

Swap/cached: 交换分区缓冲的大小

VIRT:  进程使用的虚拟内存的大小

man给出的解释: Virtual Image. The total amount of virtual memory used by the task. It includes all code, data and shared libraries. plus pages that have been swapped out.

(Note: you can define the STATSIZE=1 evvironment variable and the VIRT will be calculated from the /proc/PID/state VmSize field)

RES: 进程实际使用的,未被换出的物理内存大小

man给出的解释: Resident size.  The non-swapped physical memory a task has used.

RES = CODE + DATA.

SHR: 进程使用的虚拟内存中,被换出的大小

man给出的解释:Shared Mem size. The amount of shared memory used by a task. It simply reflects memory that could be potentially shared with other processes.

%MEM: 进程所占物理内存的百分比

man给出的解释:Memory usage. A task's currently used share of available pyhsical memory.

2. ps

root@localhost:/tmp# ps aux
USER  PID    %CPU  %MEM    VSZ    RSS  TTY  STAT  START  TIME  COMMAND
root  29060  24.0  0.8  3143100  66092  ?   Sl    10:36  0:29  nginx: worker process

%MEM: 进程所占物理内存的百分比

VSZ: 程序占用的虚拟内存大小

RSS:程序占用的物理内存大小(PS: 等同于top中RES的值)

3. pmap

pmap -d 11070

11070:   nginx: worker process
Address           Kbytes Mode  Offset           Device    Mapping
0000000000400000    6060 r-x-- 0000000000000000 041:00094 nginx
0000000000beb000     512 rw--- 00000000005eb000 041:00094 nginx
0000000000c6b000     388 rw--- 0000000000000000 000:00000   [ anon ]
000000000239d000     400 rw--- 0000000000000000 000:00000   [ anon ]
0000000002401000    1588 rw--- 0000000000000000 000:00000   [ anon ]
0000003014200000     928 r-x-- 0000000000000000 001:00000 libstdc++.so.6
00000030142e8000    2048 ----- 00000000000e8000 001:00000 libstdc++.so.6
00000030144e8000      28 r---- 00000000000e8000 001:00000 libstdc++.so.6
00000030144ef000       8 rw--- 00000000000ef000 001:00000 libstdc++.so.6
00000030144f1000      84 rw--- 0000000000000000 000:00000   [ anon ]
00000030a8200000      84 r-x-- 0000000000000000 001:00000 libz.so.1.2.3
00000030a8215000    2044 ----- 0000000000015000 001:00000 libz.so.1.2.3
00000030a8414000       4 r---- 0000000000014000 001:00000 libz.so.1.2.3
00000030a8415000       4 rw--- 0000000000015000 001:00000 libz.so.1.2.3
0000003211800000     128 r-x-- 0000000000000000 001:00000 ld-2.12.so
0000003211a1f000       4 r---- 000000000001f000 001:00000 ld-2.12.so
0000003211a20000       4 rw--- 0000000000020000 001:00000 ld-2.12.so
0000003211a21000       4 rw--- 0000000000000000 000:00000   [ anon ]
0000003211c00000       8 r-x-- 0000000000000000 001:00000 libdl-2.12.so
0000003211c02000    2048 ----- 0000000000002000 001:00000 libdl-2.12.so
0000003211e02000       4 r---- 0000000000002000 001:00000 libdl-2.12.so
0000003211e03000       4 rw--- 0000000000003000 001:00000 libdl-2.12.so
0000003212000000    1572 r-x-- 0000000000000000 001:00000 libc-2.12.so
0000003212189000    2044 ----- 0000000000189000 001:00000 libc-2.12.so
0000003212388000      16 r---- 0000000000188000 001:00000 libc-2.12.so
000000321238c000       4 rw--- 000000000018c000 001:00000 libc-2.12.so
000000321238d000      20 rw--- 0000000000000000 000:00000   [ anon ]
0000003212400000      92 r-x-- 0000000000000000 001:00000 libpthread-2.12.so
0000003212417000    2048 ----- 0000000000017000 001:00000 libpthread-2.12.so
0000003212617000       4 r---- 0000000000017000 001:00000 libpthread-2.12.so
0000003212618000       4 rw--- 0000000000018000 001:00000 libpthread-2.12.so
0000003212619000      16 rw--- 0000000000000000 000:00000   [ anon ]
0000003212c00000     524 r-x-- 0000000000000000 001:00000 libm-2.12.so
0000003212c83000    2044 ----- 0000000000083000 001:00000 libm-2.12.so
0000003212e82000       4 r---- 0000000000082000 001:00000 libm-2.12.so
0000003212e83000       4 rw--- 0000000000083000 001:00000 libm-2.12.so
0000003213000000      28 r-x-- 0000000000000000 001:00000 librt-2.12.so
0000003213007000    2044 ----- 0000000000007000 001:00000 librt-2.12.so
0000003213206000       4 r---- 0000000000006000 001:00000 librt-2.12.so
0000003213207000       4 rw--- 0000000000007000 001:00000 librt-2.12.so
0000003214800000      88 r-x-- 0000000000000000 001:00000 libgcc_s-4.4.6-20120305.so.1
0000003214816000    2044 ----- 0000000000016000 001:00000 libgcc_s-4.4.6-20120305.so.1
0000003214a15000       4 rw--- 0000000000015000 001:00000 libgcc_s-4.4.6-20120305.so.1
0000003215000000      88 r-x-- 0000000000000000 001:00000 libnsl-2.12.so
0000003215016000    2044 ----- 0000000000016000 001:00000 libnsl-2.12.so
0000003215215000       4 r---- 0000000000015000 001:00000 libnsl-2.12.so
0000003215216000       4 rw--- 0000000000016000 001:00000 libnsl-2.12.so
0000003215217000       8 rw--- 0000000000000000 000:00000   [ anon ]
0000003216c00000      28 r-x-- 0000000000000000 001:00000 libcrypt-2.12.so
0000003216c07000    2048 ----- 0000000000007000 001:00000 libcrypt-2.12.so
0000003216e07000       4 r---- 0000000000007000 001:00000 libcrypt-2.12.so
0000003216e08000       4 rw--- 0000000000008000 001:00000 libcrypt-2.12.so
0000003216e09000     184 rw--- 0000000000000000 000:00000   [ anon ]
0000003217000000     372 r-x-- 0000000000000000 001:00000 libfreebl3.so
000000321705d000    2044 ----- 000000000005d000 001:00000 libfreebl3.so
000000321725c000       4 r---- 000000000005c000 001:00000 libfreebl3.so
000000321725d000       4 rw--- 000000000005d000 001:00000 libfreebl3.so
000000321725e000      16 rw--- 0000000000000000 000:00000   [ anon ]
00000036c0e00000    1484 r-x-- 0000000000000000 001:00000 libcrypto.so.1.0.0
00000036c0f73000    2048 ----- 0000000000173000 001:00000 libcrypto.so.1.0.0
00000036c1173000     100 r---- 0000000000173000 001:00000 libcrypto.so.1.0.0
00000036c118c000      40 rw--- 000000000018c000 001:00000 libcrypto.so.1.0.0
00000036c1196000      16 rw--- 0000000000000000 000:00000   [ anon ]
00007fcfe4000000     160 rw--- 0000000000000000 000:00000   [ anon ]
00007fcfe4028000   65376 ----- 0000000000000000 000:00000   [ anon ]
00007fcfec000000     192 rw--- 0000000000000000 000:00000   [ anon ]
00007fcfec030000   65344 ----- 0000000000000000 000:00000   [ anon ]
00007fcff0000000     448 rw--- 0000000000000000 000:00000   [ anon ]
00007fcff0070000   65088 ----- 0000000000000000 000:00000   [ anon ]
00007fcff4000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fcff4021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fcff8000000     444 rw--- 0000000000000000 000:00000   [ anon ]
00007fcff806f000   65092 ----- 0000000000000000 000:00000   [ anon ]
00007fcffc000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fcffc021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd000000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd000021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd004000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd004021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd008000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd008021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd00c000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd00c021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd010000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd010021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd014000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd014021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd018000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd018021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd01c000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd01c021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd020000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd020021000   65404 ----- 0000000000000000 000:00000   [ anon ]
00007fd024000000     132 rw--- 0000000000000000 000:00000   [ anon ]
00007fd024021000   65404 ----- 0000000000000000 000:00000   [ anon ]
......
00007fd0a43dd000    2048 rw--- 0000000000000000 000:00000   [ anon ]
00007fd0a465e000     828 rw--- 0000000000000000 000:00000   [ anon ]
00007fd0a472d000      48 r-x-- 0000000000000000 001:00000 libnss_files-2.12.so
00007fd0a4739000    2048 ----- 000000000000c000 001:00000 libnss_files-2.12.so
00007fd0a4939000       4 r---- 000000000000c000 001:00000 libnss_files-2.12.so
00007fd0a493a000       4 rw--- 000000000000d000 001:00000 libnss_files-2.12.so
00007fd0a493b000      40 r-x-- 0000000000000000 001:00000 libnss_nis-2.12.so
00007fd0a4945000    2044 ----- 000000000000a000 001:00000 libnss_nis-2.12.so
00007fd0a4b44000       4 r---- 0000000000009000 001:00000 libnss_nis-2.12.so
00007fd0a4b45000       4 rw--- 000000000000a000 001:00000 libnss_nis-2.12.so
00007fd0a4b46000      32 r-x-- 0000000000000000 001:00000 libnss_compat-2.12.so
00007fd0a4b4e000    2044 ----- 0000000000008000 001:00000 libnss_compat-2.12.so
00007fd0a4d4d000       4 r---- 0000000000007000 001:00000 libnss_compat-2.12.so
00007fd0a4d4e000       4 rw--- 0000000000008000 001:00000 libnss_compat-2.12.so
00007fd0a4d4f000      32 rw--- 0000000000000000 000:00000   [ anon ]
00007fd0a4d57000      12 rw--- 0000000000000000 000:00000   [ anon ]
00007fd0a4d5a000       4 rw-s- 0000000000000000 000:00004 zero (deleted)
00007fd0a4d5b000       4 rw--- 0000000000000000 000:00000   [ anon ]
00007fff0abc5000     532 rw--- 0000000000000000 000:00000   [ stack ]
00007fff0ad9a000       4 r-x-- 0000000000000000 000:00000   [ anon ]
ffffffffff600000       4 r-x-- 0000000000000000 000:00000   [ anon ]
mapped: 3043680K    writeable/private: 133268K    shared: 4K

Address: start address of map

Kbytes: size of map in kilobytes

RSS:resident set size in kilobytes

Dirty: dirty pages (both shared and private) in kilybytes

Mode: permissions on map: read, write, execute, shared, private(copy on write)

Mapping: file backing the map, or '[anon]' for allocated memory, or '[stack]' for the program stack

Offset: offset into the file

Device: device name ( major:minor )

4. /proc/$PID/status

Name:   nginx
State:  S (sleeping)
Tgid:   4214
Pid:    4214
PPid:   4213
TracerPid:      0
Uid:    0       0       0       0
Gid:    0       0       0       0
FDSize: 512
Groups: 0
VmPeak:  5090636 kB
VmSize:  4400960 kB
VmLck:         0 kB
VmPin:         0 kB
VmHWM:    242376 kB
VmRSS:    112612 kB
VmData:  4356556 kB
VmStk:      1052 kB
VmExe:      6312 kB
VmLib:      5544 kB
VmPTE:      1152 kB
VmSwap:        0 kB
Threads:        52
SigQ:   0/62389
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000001000
SigCgt: 00000001f8016eff
CapInh: 0000000000000000
CapPrm: 0000001fffffffff
CapEff: 0000001fffffffff
CapBnd: 0000001fffffffff
Seccomp:        0
Cpus_allowed:   ff
Cpus_allowed_list:      0-7
Mems_allowed:   1
Mems_allowed_list:      0
voluntary_ctxt_switches:        2853666
nonvoluntary_ctxt_switches:     10003

VmPeak: Peak virtual memory size

VmSize: Virtual memory size

VmLock: Locked memory size

VmHWM: Peak resident set size ("high water mark") 

VmRSS: Resident set size

VmData: Size of data

VmStk: Size of stack

VmExe:Size of text segments

VmLib:Shared library code size

VmPTE:Page table entries size

注: ps 中的 VIRT 取值为 VmSize,RSS取值为VmRSS

5. /proc/$PID/maps

查看进程的地址映射表

00c81000-00cca000 rw-p 00000000 00:00 0
0218b000-021cd000 rw-p 00000000 00:00 0                                  [heap]
021cd000-02acf000 rw-p 00000000 00:00 0                                  [heap]
3014200000-30142e8000 r-xp 00000000 01:00 17822                          /usr/lib64/libstdc++.so.6
30142e8000-30144e8000 ---p 000e8000 01:00 17822                          /usr/lib64/libstdc++.so.6
30144e8000-30144ef000 r--p 000e8000 01:00 17822                          /usr/lib64/libstdc++.so.6
30144ef000-30144f1000 rw-p 000ef000 01:00 17822                          /usr/lib64/libstdc++.so.6
30144f1000-3014506000 rw-p 00000000 00:00 0
30a8200000-30a8215000 r-xp 00000000 01:00 49369                          /lib64/libz.so.1.2.3
30a8215000-30a8414000 ---p 00015000 01:00 49369                          /lib64/libz.so.1.2.3
30a8414000-30a8415000 r--p 00014000 01:00 49369                          /lib64/libz.so.1.2.3
30a8415000-30a8416000 rw-p 00015000 01:00 49369                          /lib64/libz.so.1.2.3
3211800000-3211820000 r-xp 00000000 01:00 17904                          /lib64/ld-2.12.so
3211a1f000-3211a20000 r--p 0001f000 01:00 17904                          /lib64/ld-2.12.so
3211a20000-3211a21000 rw-p 00020000 01:00 17904                          /lib64/ld-2.12.so
3211a21000-3211a22000 rw-p 00000000 00:00 0
3211c00000-3211c02000 r-xp 00000000 01:00 73                             /lib64/libdl-2.12.so
3211c02000-3211e02000 ---p 00002000 01:00 73                             /lib64/libdl-2.12.so
3211e02000-3211e03000 r--p 00002000 01:00 73                             /lib64/libdl-2.12.so
3211e03000-3211e04000 rw-p 00003000 01:00 73                             /lib64/libdl-2.12.so
3212000000-3212189000 r-xp 00000000 01:00 28852                          /lib64/libc-2.12.so
3212189000-3212388000 ---p 00189000 01:00 28852                          /lib64/libc-2.12.so
3212388000-321238c000 r--p 00188000 01:00 28852                          /lib64/libc-2.12.so
321238c000-321238d000 rw-p 0018c000 01:00 28852                          /lib64/libc-2.12.so
321238d000-3212392000 rw-p 00000000 00:00 0
3212400000-3212417000 r-xp 00000000 01:00 46636                          /lib64/libpthread-2.12.so
3212417000-3212617000 ---p 00017000 01:00 46636                          /lib64/libpthread-2.12.so
3212617000-3212618000 r--p 00017000 01:00 46636                          /lib64/libpthread-2.12.so
3212618000-3212619000 rw-p 00018000 01:00 46636                          /lib64/libpthread-2.12.so
3212619000-321261d000 rw-p 00000000 00:00 0
3212c00000-3212c83000 r-xp 00000000 01:00 30217                          /lib64/libm-2.12.so
3212c83000-3212e82000 ---p 00083000 01:00 30217                          /lib64/libm-2.12.so
3212e82000-3212e83000 r--p 00082000 01:00 30217                          /lib64/libm-2.12.so
3212e83000-3212e84000 rw-p 00083000 01:00 30217                          /lib64/libm-2.12.so
3213000000-3213007000 r-xp 00000000 01:00 60313                          /lib64/librt-2.12.so
3213007000-3213206000 ---p 00007000 01:00 60313                          /lib64/librt-2.12.so
3213206000-3213207000 r--p 00006000 01:00 60313                          /lib64/librt-2.12.so
3213207000-3213208000 rw-p 00007000 01:00 60313                          /lib64/librt-2.12.so
3214800000-3214816000 r-xp 00000000 01:00 31584                          /lib64/libgcc_s-4.4.6-20120305.so.1
3214816000-3214a15000 ---p 00016000 01:00 31584                          /lib64/libgcc_s-4.4.6-20120305.so.1
3214a15000-3214a16000 rw-p 00015000 01:00 31584                          /lib64/libgcc_s-4.4.6-20120305.so.1
3215000000-3215016000 r-xp 00000000 01:00 16535                          /lib64/libnsl-2.12.so
3215016000-3215215000 ---p 00016000 01:00 16535                          /lib64/libnsl-2.12.so
3215215000-3215216000 r--p 00015000 01:00 16535                          /lib64/libnsl-2.12.so
3215216000-3215217000 rw-p 00016000 01:00 16535                          /lib64/libnsl-2.12.so
3215217000-3215219000 rw-p 00000000 00:00 0
3216c00000-3216c07000 r-xp 00000000 01:00 45267                          /lib64/libcrypt-2.12.so
3216c07000-3216e07000 ---p 00007000 01:00 45267                          /lib64/libcrypt-2.12.so
3216e07000-3216e08000 r--p 00007000 01:00 45267                          /lib64/libcrypt-2.12.so
3216e08000-3216e09000 rw-p 00008000 01:00 45267                          /lib64/libcrypt-2.12.so
3216e09000-3216e37000 rw-p 00000000 00:00 0
3217000000-321705d000 r-xp 00000000 01:00 23382                          /lib64/libfreebl3.so
321705d000-321725c000 ---p 0005d000 01:00 23382                          /lib64/libfreebl3.so
321725c000-321725d000 r--p 0005c000 01:00 23382                          /lib64/libfreebl3.so
321725d000-321725e000 rw-p 0005d000 01:00 23382                          /lib64/libfreebl3.so
321725e000-3217262000 rw-p 00000000 00:00 0
36c0e00000-36c0f73000 r-xp 00000000 01:00 23260                          /usr/lib64/libcrypto.so.1.0.0
36c0f73000-36c1173000 ---p 00173000 01:00 23260                          /usr/lib64/libcrypto.so.1.0.0
36c1173000-36c118c000 r--p 00173000 01:00 23260                          /usr/lib64/libcrypto.so.1.0.0
36c118c000-36c1196000 rw-p 0018c000 01:00 23260                          /usr/lib64/libcrypto.so.1.0.0
36c1196000-36c119a000 rw-p 00000000 00:00 0
7f2680000000-7f2680021000 rw-p 00000000 00:00 0
7f2680021000-7f2684000000 ---p 00000000 00:00 0
7f2684000000-7f2684051000 rw-p 00000000 00:00 0
7f2684051000-7f2688000000 ---p 00000000 00:00 0
7f2688000000-7f2688021000 rw-p 00000000 00:00 0
7f2688021000-7f268c000000 ---p 00000000 00:00 0
7f268c000000-7f268c021000 rw-p 00000000 00:00 0
7f268c021000-7f2690000000 ---p 00000000 00:00 0
7f2690000000-7f2690028000 rw-p 00000000 00:00 0
7f2690028000-7f2694000000 ---p 00000000 00:00 0
7f2694000000-7f2694050000 rw-p 00000000 00:00 0
7f2694050000-7f2698000000 ---p 00000000 00:00 0
7f2698000000-7f26980e6000 rw-p 00000000 00:00 0
7f26980e6000-7f269c000000 ---p 00000000 00:00 0
7f269c000000-7f269c0ee000 rw-p 00000000 00:00 0
7f269c0ee000-7f26a0000000 ---p 00000000 00:00 0
7f26a0000000-7f26a00e6000 rw-p 00000000 00:00 0
7f26a00e6000-7f26a4000000 ---p 00000000 00:00 0
7f26a4000000-7f26a40e4000 rw-p 00000000 00:00 0
7f26a40e4000-7f26a8000000 ---p 00000000 00:00 0
7f26a8000000-7f26a80e8000 rw-p 00000000 00:00 0
7f26a80e8000-7f26ac000000 ---p 00000000 00:00 0
7f26b0000000-7f26b00ef000 rw-p 00000000 00:00 0
7f26b00ef000-7f26b4000000 ---p 00000000 00:00 0
7f26b8000000-7f26b80e7000 rw-p 00000000 00:00 0
7f26b80e7000-7f26bc000000 ---p 00000000 00:00 0
7f26bd4fc000-7f26bd4fd000 ---p 00000000 00:00 0
7f26bd4fd000-7f26bdcfd000 rw-p 00000000 00:00 0                          [stack:3069]
7f26bdcfd000-7f26bdcfe000 ---p 00000000 00:00 0
7f26bdcfe000-7f26be4fe000 rw-p 00000000 00:00 0                          [stack:18374]
7f26be4fe000-7f26be4ff000 ---p 00000000 00:00 0
7f26be4ff000-7f26becff000 rw-p 00000000 00:00 0                          [stack:25856]
7f26becff000-7f26bed00000 ---p 00000000 00:00 0
7f26bed00000-7f26bf500000 rw-p 00000000 00:00 0                          [stack:25294]
7f26bf7ff000-7f26bf800000 ---p 00000000 00:00 0
7f26bf800000-7f26c0000000 rw-p 00000000 00:00 0
......
7f26cdd0e000-7f26ce5dd000 rw-p 00000000 00:00 0                          [stack:25280]
7f26ce5dd000-7f26ce5e9000 r-xp 00000000 01:00 6963                       /lib64/libnss_files-2.12.so
7f26ce5e9000-7f26ce7e9000 ---p 0000c000 01:00 6963                       /lib64/libnss_files-2.12.so
7f26ce7e9000-7f26ce7ea000 r--p 0000c000 01:00 6963                       /lib64/libnss_files-2.12.so
7f26ce7ea000-7f26ce7eb000 rw-p 0000d000 01:00 6963                       /lib64/libnss_files-2.12.so
7f26ce7eb000-7f26ce7f5000 r-xp 00000000 01:00 52110                      /lib64/libnss_nis-2.12.so
7f26ce7f5000-7f26ce9f4000 ---p 0000a000 01:00 52110                      /lib64/libnss_nis-2.12.so
7f26ce9f4000-7f26ce9f5000 r--p 00009000 01:00 52110                      /lib64/libnss_nis-2.12.so
7f26ce9f5000-7f26ce9f6000 rw-p 0000a000 01:00 52110                      /lib64/libnss_nis-2.12.so
7f26ce9f6000-7f26ce9fe000 r-xp 00000000 01:00 2862                       /lib64/libnss_compat-2.12.so
7f26ce9fe000-7f26cebfd000 ---p 00008000 01:00 2862                       /lib64/libnss_compat-2.12.so
7f26cebfd000-7f26cebfe000 r--p 00007000 01:00 2862                       /lib64/libnss_compat-2.12.so
7f26cebfe000-7f26cebff000 rw-p 00008000 01:00 2862                       /lib64/libnss_compat-2.12.so
7f26cebff000-7f26cec07000 rw-p 00000000 00:00 0
7f26cec08000-7f26cec0a000 rw-p 00000000 00:00 0
7f26cec0a000-7f26cec0b000 rw-s 00000000 00:04 24778850                   /dev/zero (deleted)
7f26cec0b000-7f26cec0c000 rw-p 00000000 00:00 0
7fffd60c6000-7fffd60ea000 rw-p 00000000 00:00 0                          [stack]
7fffd61ff000-7fffd6200000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

第一列表示为 地址:  内存段的虚拟地址

第二列表示为 权限: 虚拟内存的权限, rwxsp(可读,可写,可执行,共享,私有)

第三列表示为 偏移量: 在进程地址里的偏移量

第四列表示为 设备: 映像文件的主设备号和次设备号

第五列表示为 节点: 映像文件的节点号(inode)

第六列表示为 路径: 映像文件的路径

6. /proc/$PID/smaps

/proc/$PID/maps 显示的是进程虚拟地址映射表的概况信息,/proc/$PID/smaps则是显示每个地址段的详细信息

36c118c000-36c1196000 rw-p 0018c000 01:00 23260                          /usr/lib64/libcrypto.so.1.0.0
Size:                 40 kB
Rss:                   8 kB
Pss:                   4 kB
Shared_Clean:          0 kB
Shared_Dirty:          8 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             8 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac
36c1196000-36c119a000 rw-p 00000000 00:00 0
Size:                 16 kB
Rss:                   0 kB
Pss:                   0 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             0 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac
7f2680000000-7f2680021000 rw-p 00000000 00:00 0
Size:                132 kB
Rss:                  44 kB
Pss:                  44 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:        44 kB
Referenced:           44 kB
Anonymous:            44 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me nr
7f2680021000-7f2684000000 ---p 00000000 00:00 0
Size:              65404 kB
Rss:                   0 kB
Pss:                   0 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             0 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: mr mw me nr
7f2684000000-7f2684051000 rw-p 00000000 00:00 0
Size:                324 kB
Rss:                 156 kB
Pss:                 156 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:       156 kB
Referenced:          156 kB
Anonymous:           156 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me nr
7f2684051000-7f2688000000 ---p 00000000 00:00 0
Size:              65212 kB
Rss:                   0 kB
Pss:                   0 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             0 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: mr mw me nr
......

 

© 著作权归作者所有

共有 人打赏支持
hncscwc
粉丝 67
博文 70
码字总数 76137
作品 0
杭州
程序员
私信 提问
查看LINUX进程内存占用情况

可以直接使用top命令后,查看%MEM的内容。可以选择按进程查看或者按用户查看,如想查看oracle用户的进程内存使用情况的话可以使用如下的命令:  (1)top   top命令是Linux下常用的性能分析...

ponpon_
2014/08/06
0
0
查看Linux进程信息

可以直接使用top命令后,查看%MEM的内容。可以选择按进程查看或者按用户查看,如想查看oracle用户的进程内存使用情况的话可以使用如下的命令:  (1)top   top命令是Linux下常用的性能分析...

SibylY
2016/05/23
64
0
w,vmstat,top,sar

1.w命令查看系统负载 w|cat查看系统负载信息,load average后的数字分别代表1分钟,5分钟,15分钟的系统负载情况 [root@test_01 ~]# w|cat 21:02:30 up 16 min, 1 user, load average: 0.00...

LavenDer7n
2017/11/27
0
0
如何查看你的process消耗了多少内存

pmap $(ps -ef|grep nginx) #查看静态内存使用情况 top 然后shift+m 查看内存使用情况进行排序 VIRT:进程占用的虚拟内存 RES:进程占用的物理内存 SHR:进程使用的共享内存 PID= cat /proc...

davis_qi
2013/01/19
0
4
linux定位应用问题的一些常用命令,特别针对内存和线程分析的dump命令

下面这些命令都是之前遇到内存占用持续升高,cpu持续居高不下或者大幅度震荡下收集信息的方法,其中dump线程信息切记要至少dump3次。 1.jps找出进程号,找到对应的进程号后面才好继续操作 2....

noob_chr
12/12
0
0

没有更多内容

加载失败,请刷新页面

加载更多

EOS官方钱包keosd

EOS官方钱包的名称是keosd,它负责管理你的私钥,并且帮你进行交易的签名。 不过不幸的是,keosd钱包对普通用户并不友好,它是一个命令行程序,目前还没有像以太坊的mist那样的图形化界面,而...

汇智网教程
今天
25
0
ArrayList的实现原理以及实现线程安全

一、ArrayList概述 ArrayList是基于数组实现的,是一个动态的数字,可以自动扩容。 ArrayList不是线程安全的,效率比较高,只能用于单线程的环境中,在多线程环境中可以使用Collections.syn...

一看就喷亏的小猿
今天
30
0
Netty 备录 (一)

入职新公司不久,修修补补1个月的bug,来了点实战性的技术---基于netty即时通信 还好之前对socket有所使用及了解,入手netty应该不是很难吧,好吧,的确有点难,刚看这玩意的时候,可能都不知道哪里...

_大侠__
昨天
34
0
Django简单介绍和用户访问流程

Python下有许多款不同的 Web 框架。Django是重量级选手中最有代表性的一位。许多成功的网站和APP都基于Django。 Django是一个开放源代码的Web应用框架,由Python写成。 Django遵守BSD版权,初...

枫叶云
昨天
47
0
Spring Cloud Stream消费失败后的处理策略(四):重新入队(RabbitMQ)

应用场景 之前我们已经通过《Spring Cloud Stream消费失败后的处理策略(一):自动重试》一文介绍了Spring Cloud Stream默认的消息重试功能。本文将介绍RabbitMQ的binder提供的另外一种重试...

程序猿DD
昨天
23
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部