linux解除地址占用,Linux:pmap命令,查看進程占用的內存及使用地址空間(轉)...

情景:

根據apache的工作方式,當我們要判斷某個httpd進程使用內存的詳細情況的時候,就用到了pmap命令:

例如:

1.查看pmap如何使用:

[root@CentOS5 ~]#man pmap

PMAP(1)                      Linux User’s Manual                     PMAP(1)

NAME

pmap - report memory map of a process

SYNOPSIS

pmap [ -x | -d ] [ -q ] pids...

pmap -V

DESCRIPTION

The pmap command reports the memory map of a process or processes.

GENERAL OPTIONS

-x  extended      Show the extended format.

-d  device        Show the device format.

-q  quiet         Do not display some header/footer lines.

-V  show version  Displays version of program.

SEE ALSO

ps(1) pgrep(1)

STANDARDS

No standards apply, but pmap looks an awful lot like a SunOS command.

AUTHOR

Albert Cahalan  wrote pmap in 2002, and is the cur-

rent maintainer of the procps collection. Please send bug reports to

.

Linux                         October 26, 2002                       PMAP(1)

(END)

2.參數說明:

-x  extended      Show the extended format.

-d  device        Show the device format.

-q  quiet         Do not display some header/footer lines.

-V  show version  Displays version of program.

3.舉例:

查看系統進程:

[root@CentOS5 ~]#ps aux

USER      PID %CPU %MEM   VSZ  RSS TTY     STAT START  TIME COMMAND

root        1 0.0 0.0  2072  616 ?       Ss  May17  0:01 init [3]

(中間部分略)

daemon   9639 0.0 0.1 21164 8484 ?       S   13:11  0:00 /usr/local/apache2/bin/httpd

(下面部分略)

[root@CentOS5 ~]#pmap -d 9639

9639:  /usr/local/apache2/bin/httpd -k start

Address  Kbytes Mode Offset          Device   Mapping

00110000     28 r-x-- 0000000000000000 008:00003 librt-2.5.so

00117000      4 r---- 0000000000006000 008:00003 librt-2.5.so

00118000      4 rw--- 0000000000007000 008:00003 librt-2.5.so

00119000   1276 r-x-- 0000000000000000 008:00003 libc-2.5.so

00258000      8 r---- 000000000013f000 008:00003 libc-2.5.so

0025a000      4 rw--- 0000000000141000 008:00003 libc-2.5.so

0025b000     12 rw--- 000000000025b000 000:00000  [ anon ]

0025e000     60 r-x-- 0000000000000000 008:00003 libexslt.so.0.8.12

0026d000      4 rw--- 000000000000e000 008:00003 libexslt.so.0.8.12

0026e000    268 r-x-- 0000000000000000 008:00003 libmysqlclient.so.16.0.0

002b1000    168 rw--- 0000000000042000 008:00003 libmysqlclient.so.16.0.0

002db000      4 rw--- 00000000002db000 000:00000  [ anon ]

002dc000    448 r-x-- 0000000000000000 008:00003 libfreetype.so.6.4.0

0034c000     16 rw--- 000000000006f000 008:00003 libfreetype.so.6.4.0

00350000     72 r-x-- 0000000000000000 008:00003 libz.so.1.2.3

00362000      4 rw--- 0000000000011000 008:00003 libz.so.1.2.3

00363000     60 r-x-- 0000000000000000 008:00003 libresolv-2.5.so

00372000      4 r---- 000000000000e000 008:00003 libresolv-2.5.so

00373000      4 rw--- 000000000000f000 008:00003 libresolv-2.5.so

00374000      8 rw--- 0000000000374000 000:00000  [ anon ]

00376000     76 r-x-- 0000000000000000 008:00003 libnsl-2.5.so

00389000      4 r---- 0000000000012000 008:00003 libnsl-2.5.so

0038a000      4 rw--- 0000000000013000 008:00003 libnsl-2.5.so

0038b000      8 rw--- 000000000038b000 000:00000  [ anon ]

0038d000    200 r-x-- 0000000000000000 008:00003 libcurl.so.3.0.0

003bf000      4 rw--- 0000000000031000 008:00003 libcurl.so.3.0.0

003c0000    192 r-x-- 0000000000000000 008:00003 libidn.so.11.5.19

003f0000      4 rw--- 000000000002f000 008:00003 libidn.so.11.5.19

003f1000    188 r-x-- 0000000000000000 008:00003 libxslt.so.1.1.15

00420000      4 rw--- 000000000002f000 008:00003 libxslt.so.1.1.15

00421000    588 r-x-- 0000000000000000 008:00003 libkrb5.so.3.3

004b4000     12 rw--- 0000000000092000 008:00003 libkrb5.so.3.3

004b7000      8 r-x-- 0000000000000000 008:00003 libcom_err.so.2.1

004b9000      4 rw--- 0000000000001000 008:00003 libcom_err.so.2.1

004ba000    148 r-x-- 0000000000000000 008:00003 libk5crypto.so.3.1

004df000      4 rw--- 0000000000025000 008:00003 libk5crypto.so.3.1

004e0000      8 r-x-- 0000000000000000 008:00003 libkeyutils-1.2.so

004e2000      4 rw--- 0000000000001000 008:00003 libkeyutils-1.2.so

004e3000     36 r-x-- 0000000000000000 008:00003 libnss_files-2.5.so

004ec000      4 r---- 0000000000008000 008:00003 libnss_files-2.5.so

004ed000      4 rw--- 0000000000009000 008:00003 libnss_files-2.5.so

004f4000    124 r-x-- 0000000000000000 008:00003 libexpat.so.0.5.0

00513000

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值