使用pmap查看进程占用的内存情况

测试程序时,想要查看程序真正占用了多少内存,top命令只能看个大概,于是就找到了pmap命令。

使用很简单:

 1 SYNOPSIS

 2        pmap [options] pid [...]

 3 

 4 DESCRIPTION

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

 6 

 7 OPTIONS

 8        -x, --extended

 9               Show the extended format.

10 

11        -d, --device

12               Show the device format.

13 

14        -q, --quiet

15               Do not display some header or footer lines.

16 

17        -A, --range low,high

18               Limit results to the given range to low and high address range.  Notice that the low and high arguments are single string separated with comma.

19 

20        -h, --help

21               Display help text and exit.

22 

23        -V, --version

24               Display version information and exit.

 

下面是我的程序内存使用情况:

  1 feng@server233:~$ pmap -d 4380

  2 4380:   /home/raozhengfeng/work/jasgreen_test/jasgreenD

  3 Address           Kbytes Mode  Offset           Device    Mapping

  4 0000000000400000    1892 r-x-- 0000000000000000 008:00003 jasgreenD

  5 00000000007d8000      36 rw--- 00000000001d8000 008:00003 jasgreenD

  6 00000000007e1000  737408 rw--- 0000000000000000 000:00000   [ anon ]

  7 00007fff38000000    2648 rw--- 0000000000000000 000:00000   [ anon ]

  8 00007fff38296000   62888 ----- 0000000000000000 000:00000   [ anon ]

  9 00007fff40000000   64732 rw--- 0000000000000000 000:00000   [ anon ]

 10 00007fff43f37000     804 ----- 0000000000000000 000:00000   [ anon ]

 11 00007fff44000000   65536 rw--- 0000000000000000 000:00000   [ anon ]

 12 00007fff48000000   65536 rw--- 0000000000000000 000:00000   [ anon ]

 13 00007fff50000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 14 00007fff58000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 15 00007fff60000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 16 00007fff68000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 17 00007fff70000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 18 00007fff78000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 19 00007fff80000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 20 00007fff88000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 21 00007fff90000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 22 00007fff98000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 23 00007fffa0000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 24 00007fffa8000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 25 00007fffb0000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 26 00007fffb8000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 27 00007fffc0000000  131072 rw--- 0000000000000000 000:00000   [ anon ]

 28 00007fffc8000000   65536 rw--- 0000000000000000 000:00000   [ anon ]

 29 00007fffcc000000   65536 rw--- 0000000000000000 000:00000   [ anon ]

 30 00007fffd3000000   16384 rw--- 0000000000000000 000:00000   [ anon ]

 31 00007fffd4000000   65536 rw--- 0000000000000000 000:00000   [ anon ]

 32 00007fffdf124000       4 ----- 0000000000000000 000:00000   [ anon ]

 33 00007fffdf125000    8712 rw--- 0000000000000000 000:00000   [ anon ]

 34 00007fffdf9a7000   65536 rw-s- 0000000000000000 008:00003 geo_locations.kch

 35 00007fffe39a7000    1220 r-x-- 0000000000000000 008:00003 libIMDBFlock.so

 36 00007fffe3ad8000    2048 ----- 0000000000131000 008:00003 libIMDBFlock.so

 37 00007fffe3cd8000      36 rw--- 0000000000131000 008:00003 libIMDBFlock.so

 38 00007fffe3ce1000    1352 r-x-- 0000000000000000 008:00003 libGeoFlock.so

 39 00007fffe3e33000    2048 ----- 0000000000152000 008:00003 libGeoFlock.so

 40 00007fffe4033000      40 rw--- 0000000000152000 008:00003 libGeoFlock.so

 41 00007fffe403d000   65536 rw-s- 0000000000000000 008:00003 id_noneed.kv.kch

 42 00007fffe803d000   65536 rw-s- 0000000000000000 008:00003 id_delete.kv.kch

 43 00007fffec03d000   65536 rw-s- 0000000000000000 008:00003 id_change.kv.kch

 44 00007ffff003d000      44 r-x-- 0000000000000000 008:00001 libnss_files-2.13.so

 45 00007ffff0048000    2044 ----- 000000000000b000 008:00001 libnss_files-2.13.so

 46 00007ffff0247000       4 r---- 000000000000a000 008:00001 libnss_files-2.13.so

 47 00007ffff0248000       4 rw--- 000000000000b000 008:00001 libnss_files-2.13.so

 48 00007ffff0249000       4 ----- 0000000000000000 000:00000   [ anon ]

 49 00007ffff024a000    8192 rw--- 0000000000000000 000:00000   [ anon ]

 50 00007ffff0a4a000       4 ----- 0000000000000000 000:00000   [ anon ]

 51 00007ffff0a4b000    8192 rw--- 0000000000000000 000:00000   [ anon ]

 52 00007ffff124b000      68 r-x-- 0000000000000000 008:00001 libp11-kit.so.0.0.0

 53 00007ffff125c000    2044 ----- 0000000000011000 008:00001 libp11-kit.so.0.0.0

 54 00007ffff145b000       4 r---- 0000000000010000 008:00001 libp11-kit.so.0.0.0

 55 00007ffff145c000       4 rw--- 0000000000011000 008:00001 libp11-kit.so.0.0.0

 56 00007ffff145d000      64 r-x-- 0000000000000000 008:00001 libtasn1.so.3.1.16

 57 00007ffff146d000    2044 ----- 0000000000010000 008:00001 libtasn1.so.3.1.16

 58 00007ffff166c000       4 r---- 000000000000f000 008:00001 libtasn1.so.3.1.16

 59 00007ffff166d000       4 rw--- 0000000000010000 008:00001 libtasn1.so.3.1.16

 60 00007ffff166e000      12 r-x-- 0000000000000000 008:00001 libgpg-error.so.0.8.0

 61 00007ffff1671000    2044 ----- 0000000000003000 008:00001 libgpg-error.so.0.8.0

 62 00007ffff1870000       4 rw--- 0000000000002000 008:00001 libgpg-error.so.0.8.0

 63 00007ffff1871000      12 r-x-- 0000000000000000 008:00001 libkeyutils.so.1.4

 64 00007ffff1874000    2044 ----- 0000000000003000 008:00001 libkeyutils.so.1.4

 65 00007ffff1a73000       4 r---- 0000000000002000 008:00001 libkeyutils.so.1.4

 66 00007ffff1a74000       4 rw--- 0000000000003000 008:00001 libkeyutils.so.1.4

 67 00007ffff1a75000      32 r-x-- 0000000000000000 008:00001 libkrb5support.so.0.1

 68 00007ffff1a7d000    2044 ----- 0000000000008000 008:00001 libkrb5support.so.0.1

 69 00007ffff1c7c000       4 r---- 0000000000007000 008:00001 libkrb5support.so.0.1

 70 00007ffff1c7d000       4 rw--- 0000000000008000 008:00001 libkrb5support.so.0.1

 71 00007ffff1c7e000      12 r-x-- 0000000000000000 008:00001 libcom_err.so.2.1

 72 00007ffff1c81000    2044 ----- 0000000000003000 008:00001 libcom_err.so.2.1

 73 00007ffff1e80000       4 r---- 0000000000002000 008:00001 libcom_err.so.2.1

 74 00007ffff1e81000       4 rw--- 0000000000003000 008:00001 libcom_err.so.2.1

 75 00007ffff1e82000     152 r-x-- 0000000000000000 008:00001 libk5crypto.so.3.1

 76 00007ffff1ea8000    2048 ----- 0000000000026000 008:00001 libk5crypto.so.3.1

 77 00007ffff20a8000       4 r---- 0000000000026000 008:00001 libk5crypto.so.3.1

 78 00007ffff20a9000       4 rw--- 0000000000027000 008:00001 libk5crypto.so.3.1

 79 00007ffff20aa000       4 rw--- 0000000000000000 000:00000   [ anon ]

 80 00007ffff20ab000     804 r-x-- 0000000000000000 008:00001 libkrb5.so.3.3

 81 00007ffff2174000    2044 ----- 00000000000c9000 008:00001 libkrb5.so.3.3

 82 00007ffff2373000      40 r---- 00000000000c8000 008:00001 libkrb5.so.3.3

 83 00007ffff237d000       8 rw--- 00000000000d2000 008:00001 libkrb5.so.3.3

 84 00007ffff237f000     740 r-x-- 0000000000000000 008:00001 libgnutls.so.26.22.4

 85 00007ffff2438000    2044 ----- 00000000000b9000 008:00001 libgnutls.so.26.22.4

 86 00007ffff2637000      24 r---- 00000000000b8000 008:00001 libgnutls.so.26.22.4

 87 00007ffff263d000       8 rw--- 00000000000be000 008:00001 libgnutls.so.26.22.4

 88 00007ffff263f000     104 r-x-- 0000000000000000 008:00001 libsasl2.so.2.0.25

 89 00007ffff2659000    2044 ----- 000000000001a000 008:00001 libsasl2.so.2.0.25

 90 00007ffff2858000       4 r---- 0000000000019000 008:00001 libsasl2.so.2.0.25

 91 00007ffff2859000       4 rw--- 000000000001a000 008:00001 libsasl2.so.2.0.25

 92 00007ffff285a000      76 r-x-- 0000000000000000 008:00001 libresolv-2.13.so

 93 00007ffff286d000    2044 ----- 0000000000013000 008:00001 libresolv-2.13.so

 94 00007ffff2a6c000       4 r---- 0000000000012000 008:00001 libresolv-2.13.so

 95 00007ffff2a6d000       4 rw--- 0000000000013000 008:00001 libresolv-2.13.so

 96 00007ffff2a6e000       8 rw--- 0000000000000000 000:00000   [ anon ]

 97 00007ffff2a70000     488 r-x-- 0000000000000000 008:00001 libgcrypt.so.11.7.0

 98 00007ffff2aea000    2048 ----- 000000000007a000 008:00001 libgcrypt.so.11.7.0

 99 00007ffff2cea000      16 rw--- 000000000007a000 008:00001 libgcrypt.so.11.7.0

100 00007ffff2cee000     100 r-x-- 0000000000000000 008:00001 librtmp.so.0

101 00007ffff2d07000    2048 ----- 0000000000019000 008:00001 librtmp.so.0

102 00007ffff2f07000       4 rw--- 0000000000019000 008:00001 librtmp.so.0

103 00007ffff2f08000     240 r-x-- 0000000000000000 008:00001 libgssapi_krb5.so.2.2

104 00007ffff2f44000    2048 ----- 000000000003c000 008:00001 libgssapi_krb5.so.2.2

105 00007ffff3144000       4 r---- 000000000003c000 008:00001 libgssapi_krb5.so.2.2

106 00007ffff3145000       8 rw--- 000000000003d000 008:00001 libgssapi_krb5.so.2.2

107 00007ffff3147000     304 r-x-- 0000000000000000 008:00001 libldap_r-2.4.so.2.8.3

108 00007ffff3193000    2048 ----- 000000000004c000 008:00001 libldap_r-2.4.so.2.8.3

109 00007ffff3393000       8 r---- 000000000004c000 008:00001 libldap_r-2.4.so.2.8.3

110 00007ffff3395000       4 rw--- 000000000004e000 008:00001 libldap_r-2.4.so.2.8.3

111 00007ffff3396000       8 rw--- 0000000000000000 000:00000   [ anon ]

112 00007ffff3398000      56 r-x-- 0000000000000000 008:00001 liblber-2.4.so.2.8.3

113 00007ffff33a6000    2044 ----- 000000000000e000 008:00001 liblber-2.4.so.2.8.3

114 00007ffff35a5000       4 r---- 000000000000d000 008:00001 liblber-2.4.so.2.8.3

115 00007ffff35a6000       4 rw--- 000000000000e000 008:00001 liblber-2.4.so.2.8.3

116 00007ffff35a7000     156 r-x-- 0000000000000000 008:00001 libssh2.so.1.0.1

117 00007ffff35ce000    2048 ----- 0000000000027000 008:00001 libssh2.so.1.0.1

118 00007ffff37ce000       4 r---- 0000000000027000 008:00001 libssh2.so.1.0.1

119 00007ffff37cf000       4 rw--- 0000000000028000 008:00001 libssh2.so.1.0.1

120 00007ffff37d0000     200 r-x-- 0000000000000000 008:00001 libidn.so.11.6.8

121 00007ffff3802000    2048 ----- 0000000000032000 008:00001 libidn.so.11.6.8

122 00007ffff3a02000       4 r---- 0000000000032000 008:00001 libidn.so.11.6.8

123 00007ffff3a03000       4 rw--- 0000000000033000 008:00001 libidn.so.11.6.8

124 00007ffff3a04000     148 r-x-- 0000000000000000 008:00001 libnettle.so.4.3

125 00007ffff3a29000    2048 ----- 0000000000025000 008:00001 libnettle.so.4.3

126 00007ffff3c29000       4 r---- 0000000000025000 008:00001 libnettle.so.4.3

127 00007ffff3c2a000       4 rw--- 0000000000026000 008:00001 libnettle.so.4.3

128 00007ffff3c2b000    1364 r-x-- 0000000000000000 008:00001 libxml2.so.2.8.0

129 00007ffff3d80000    2044 ----- 0000000000155000 008:00001 libxml2.so.2.8.0

130 00007ffff3f7f000      32 r---- 0000000000154000 008:00001 libxml2.so.2.8.0

131 00007ffff3f87000       8 rw--- 000000000015c000 008:00001 libxml2.so.2.8.0

132 00007ffff3f89000       4 rw--- 0000000000000000 000:00000   [ anon ]

133 00007ffff3f8a000     132 r-x-- 0000000000000000 008:00001 liblzma.so.5.0.0

134 00007ffff3fab000    2048 ----- 0000000000021000 008:00001 liblzma.so.5.0.0

135 00007ffff41ab000       4 r---- 0000000000021000 008:00001 liblzma.so.5.0.0

136 00007ffff41ac000       4 rw--- 0000000000022000 008:00001 liblzma.so.5.0.0

137 00007ffff41ad000      16 r-x-- 0000000000000000 008:00001 libattr.so.1.1.0

138 00007ffff41b1000    2044 ----- 0000000000004000 008:00001 libattr.so.1.1.0

139 00007ffff43b0000       4 r---- 0000000000003000 008:00001 libattr.so.1.1.0

140 00007ffff43b1000       4 rw--- 0000000000004000 008:00001 libattr.so.1.1.0

141 00007ffff43b2000      32 r-x-- 0000000000000000 008:00001 libacl.so.1.1.0

142 00007ffff43ba000    2044 ----- 0000000000008000 008:00001 libacl.so.1.1.0

143 00007ffff45b9000       4 r---- 0000000000007000 008:00001 libacl.so.1.1.0

144 00007ffff45ba000       4 rw--- 0000000000008000 008:00001 libacl.so.1.1.0

145 00007ffff45bb000      84 r-x-- 0000000000000000 008:00001 libnsl-2.13.so

146 00007ffff45d0000    2044 ----- 0000000000015000 008:00001 libnsl-2.13.so

147 00007ffff47cf000       4 r---- 0000000000014000 008:00001 libnsl-2.13.so

148 00007ffff47d0000       4 rw--- 0000000000015000 008:00001 libnsl-2.13.so

149 00007ffff47d1000       8 rw--- 0000000000000000 000:00000   [ anon ]

150 00007ffff47d3000      28 r-x-- 0000000000000000 008:00001 librt-2.13.so

151 00007ffff47da000    2044 ----- 0000000000007000 008:00001 librt-2.13.so

152 00007ffff49d9000       4 r---- 0000000000006000 008:00001 librt-2.13.so

153 00007ffff49da000       4 rw--- 0000000000007000 008:00001 librt-2.13.so

154 00007ffff49db000    1752 r-x-- 0000000000000000 008:00001 libcrypto.so.1.0.0

155 00007ffff4b91000    2048 ----- 00000000001b6000 008:00001 libcrypto.so.1.0.0

156 00007ffff4d91000     108 r---- 00000000001b6000 008:00001 libcrypto.so.1.0.0

157 00007ffff4dac000      60 rw--- 00000000001d1000 008:00001 libcrypto.so.1.0.0

158 00007ffff4dbb000      16 rw--- 0000000000000000 000:00000   [ anon ]

159 00007ffff4dbf000      88 r-x-- 0000000000000000 008:00001 libz.so.1.2.7

160 00007ffff4dd5000    2044 ----- 0000000000016000 008:00001 libz.so.1.2.7

161 00007ffff4fd4000       4 r---- 0000000000015000 008:00001 libz.so.1.2.7

162 00007ffff4fd5000       4 rw--- 0000000000016000 008:00001 libz.so.1.2.7

163 00007ffff4fd6000      92 r-x-- 0000000000000000 008:00001 libpthread-2.13.so

164 00007ffff4fed000    2044 ----- 0000000000017000 008:00001 libpthread-2.13.so

165 00007ffff51ec000       4 r---- 0000000000016000 008:00001 libpthread-2.13.so

166 00007ffff51ed000       4 rw--- 0000000000017000 008:00001 libpthread-2.13.so

167 00007ffff51ee000      16 rw--- 0000000000000000 000:00000   [ anon ]

168 00007ffff51f2000    1524 r-x-- 0000000000000000 008:00001 libc-2.13.so

169 00007ffff536f000    2048 ----- 000000000017d000 008:00001 libc-2.13.so

170 00007ffff556f000      16 r---- 000000000017d000 008:00001 libc-2.13.so

171 00007ffff5573000       4 rw--- 0000000000181000 008:00001 libc-2.13.so

172 00007ffff5574000      20 rw--- 0000000000000000 000:00000   [ anon ]

173 00007ffff5579000      84 r-x-- 0000000000000000 008:00001 libgcc_s.so.1

174 00007ffff558e000    2048 ----- 0000000000015000 008:00001 libgcc_s.so.1

175 00007ffff578e000       4 rw--- 0000000000015000 008:00001 libgcc_s.so.1

176 00007ffff578f000     516 r-x-- 0000000000000000 008:00001 libm-2.13.so

177 00007ffff5810000    2044 ----- 0000000000081000 008:00001 libm-2.13.so

178 00007ffff5a0f000       4 r---- 0000000000080000 008:00001 libm-2.13.so

179 00007ffff5a10000       4 rw--- 0000000000081000 008:00001 libm-2.13.so

180 00007ffff5a11000     928 r-x-- 0000000000000000 008:00001 libstdc++.so.6.0.17

181 00007ffff5af9000    2048 ----- 00000000000e8000 008:00001 libstdc++.so.6.0.17

182 00007ffff5cf9000      32 r---- 00000000000e8000 008:00001 libstdc++.so.6.0.17

183 00007ffff5d01000       8 rw--- 00000000000f0000 008:00001 libstdc++.so.6.0.17

184 00007ffff5d03000      84 rw--- 0000000000000000 000:00000   [ anon ]

185 00007ffff5d18000    1016 r-x-- 0000000000000000 008:00001 libkyotocabinet.so.16.13.0

186 00007ffff5e16000    2044 ----- 00000000000fe000 008:00001 libkyotocabinet.so.16.13.0

187 00007ffff6015000      32 rw--- 00000000000fd000 008:00001 libkyotocabinet.so.16.13.0

188 00007ffff601d000     124 r-x-- 0000000000000000 008:00001 libboost_filesystem.so.1.49.0

189 00007ffff603c000    2044 ----- 000000000001f000 008:00001 libboost_filesystem.so.1.49.0

190 00007ffff623b000       8 rw--- 000000000001e000 008:00001 libboost_filesystem.so.1.49.0

191 00007ffff623d000    2868 r-x-- 0000000000000000 008:00001 libmysqlclient.so.18.0.0

192 00007ffff650a000    2044 ----- 00000000002cd000 008:00001 libmysqlclient.so.18.0.0

193 00007ffff6709000      24 r---- 00000000002cc000 008:00001 libmysqlclient.so.18.0.0

194 00007ffff670f000     504 rw--- 00000000002d2000 008:00001 libmysqlclient.so.18.0.0

195 00007ffff678d000      20 rw--- 0000000000000000 000:00000   [ anon ]

196 00007ffff6792000     408 r-x-- 0000000000000000 008:00001 libcurl.so.4.2.0

197 00007ffff67f8000    2044 ----- 0000000000066000 008:00001 libcurl.so.4.2.0

198 00007ffff69f7000      12 r---- 0000000000065000 008:00001 libcurl.so.4.2.0

199 00007ffff69fa000       4 rw--- 0000000000068000 008:00001 libcurl.so.4.2.0

200 00007ffff69fb000     336 r-x-- 0000000000000000 008:00001 libssl.so.1.0.0

201 00007ffff6a4f000    2048 ----- 0000000000054000 008:00001 libssl.so.1.0.0

202 00007ffff6c4f000      12 r---- 0000000000054000 008:00001 libssl.so.1.0.0

203 00007ffff6c52000      28 rw--- 0000000000057000 008:00001 libssl.so.1.0.0

204 00007ffff6c59000      60 r-x-- 0000000000000000 008:00001 libbz2.so.1.0.4

205 00007ffff6c68000    2044 ----- 000000000000f000 008:00001 libbz2.so.1.0.4

206 00007ffff6e67000       4 r---- 000000000000e000 008:00001 libbz2.so.1.0.4

207 00007ffff6e68000       4 rw--- 000000000000f000 008:00001 libbz2.so.1.0.4

208 00007ffff6e69000     604 r-x-- 0000000000000000 008:00001 libarchive.so.12.0.4

209 00007ffff6f00000    2048 ----- 0000000000097000 008:00001 libarchive.so.12.0.4

210 00007ffff7100000       8 r---- 0000000000097000 008:00001 libarchive.so.12.0.4

211 00007ffff7102000       8 rw--- 0000000000099000 008:00001 libarchive.so.12.0.4

212 00007ffff7104000       4 rw--- 0000000000000000 000:00000   [ anon ]

213 00007ffff7105000      12 r-x-- 0000000000000000 008:00001 libboost_system.so.1.49.0

214 00007ffff7108000    2044 ----- 0000000000003000 008:00001 libboost_system.so.1.49.0

215 00007ffff7307000       4 rw--- 0000000000002000 008:00001 libboost_system.so.1.49.0

216 00007ffff7308000      60 r-x-- 0000000000000000 008:00001 libboost_date_time.so.1.49.0

217 00007ffff7317000    2044 ----- 000000000000f000 008:00001 libboost_date_time.so.1.49.0

218 00007ffff7516000       8 rw--- 000000000000e000 008:00001 libboost_date_time.so.1.49.0

219 00007ffff7518000       8 r-x-- 0000000000000000 008:00001 libdl-2.13.so

220 00007ffff751a000    2048 ----- 0000000000002000 008:00001 libdl-2.13.so

221 00007ffff771a000       4 r---- 0000000000002000 008:00001 libdl-2.13.so

222 00007ffff771b000       4 rw--- 0000000000003000 008:00001 libdl-2.13.so

223 00007ffff771c000     104 r-x-- 0000000000000000 008:00001 libboost_thread.so.1.49.0

224 00007ffff7736000    2048 ----- 000000000001a000 008:00001 libboost_thread.so.1.49.0

225 00007ffff7936000       8 rw--- 000000000001a000 008:00001 libboost_thread.so.1.49.0

226 00007ffff7938000     256 r-x-- 0000000000000000 008:00001 liblog4cpp.so.5.0.5

227 00007ffff7978000    2048 ----- 0000000000040000 008:00001 liblog4cpp.so.5.0.5

228 00007ffff7b78000      12 rw--- 0000000000040000 008:00001 liblog4cpp.so.5.0.5

229 00007ffff7b7b000     376 r-x-- 0000000000000000 008:00001 libboost_program_options.so.1.49.0

230 00007ffff7bd9000    2048 ----- 000000000005e000 008:00001 libboost_program_options.so.1.49.0

231 00007ffff7dd9000      16 rw--- 000000000005e000 008:00001 libboost_program_options.so.1.49.0

232 00007ffff7ddd000     128 r-x-- 0000000000000000 008:00001 ld-2.13.so

233 00007ffff7e22000     264 rw--- 0000000000000000 000:00000   [ anon ]

234 00007ffff7e64000    1500 r---- 0000000000000000 008:00001 locale-archive

235 00007ffff7fdb000      88 rw--- 0000000000000000 000:00000   [ anon ]

236 00007ffff7ff1000      28 r--s- 0000000000000000 008:00001 gconv-modules.cache

237 00007ffff7ff8000      12 rw--- 0000000000000000 000:00000   [ anon ]

238 00007ffff7ffb000       4 r-x-- 0000000000000000 000:00000   [ anon ]

239 00007ffff7ffc000       4 r---- 000000000001f000 008:00001 ld-2.13.so

240 00007ffff7ffd000       4 rw--- 0000000000020000 008:00001 ld-2.13.so

241 00007ffff7ffe000       4 rw--- 0000000000000000 000:00000   [ anon ]

242 00007ffffffde000     132 rw--- 0000000000000000 000:00000   [ stack ]

243 ffffffffff600000       4 r-x-- 0000000000000000 000:00000   [ anon ]

244 mapped: 3588968K    writeable/private: 3141696K    shared: 262172K

可以看到程序总共使用了3G多的内存,有点恐怖哈。。。。

 

再分析一下,可以看到大部分内存都是被类似“00007fff50000000 131072 rw--- 0000000000000000 000:00000 [ anon ]” 这样的情况给占用的,这里面的“anon”是啥呢?

“应该是叫匿名的地址,一般在堆里面分配?”http://bbs.chinaunix.net/thread-2065212-1-1.html

也许就是anonymous的堆栈吧。。。。

 

 

你可能感兴趣的:(map)