doujia4041
doujia4041
2009-09-28 14:57

如何在巨大的Apache / PHP驻留内存使用上找到罪魁祸首模块或脚本?

已采纳

System: Centos 5.3 x86_64, with Apache 2.2 and PHP 5.2 as module (with mysql and oracle connectors)

How to debug memory usage / leaks ? dmalloc ? Valgrind ? auto_prepend_file ?

We're looking at 500+ MB VSZ and 50+ MB RSS for example, but it can be somewhat higher. And as the instances add up, we end up needing much more memory than with SuSE 9.2 i386, Apache 2.0, PHP 5.2 and we are not sure if the 32->64 bits change is the only cause of inflated memory ... Apache and PHP look like a blackbox (or at least their heap :)

$ sudo pmap -d 31506
31506:   /usr/sbin/httpd -DSSL
Address           Kbytes Mode  Offset           Device    Mapping
00002b335c123000     308 r-x-- 0000000000000000 008:00005 httpd
00002b335c178000      28 r--s- 0000000000000000 008:00005 gconv-modules.cache
00002b335c1ee000      56 rw-s- 0000000000000000 000:00009 zero (deleted)
00002b335c1fc000    1024 rw--- 00002b335c1fc000 000:00000   [ anon ]
00002b335c370000      16 rw--- 000000000004d000 008:00005 httpd
00002b335c374000      12 rw--- 00002b335c374000 000:00000   [ anon ]
00002b335c377000     112 r-x-- 0000000000000000 008:00003 ld-2.5.so
00002b335c393000       4 rw--- 00002b335c393000 000:00000   [ anon ]
00002b335c39b000    1028 rw--- 00002b335c39b000 000:00000   [ anon ]
00002b335c592000       4 r---- 000000000001b000 008:00003 ld-2.5.so
00002b335c593000       4 rw--- 000000000001c000 008:00003 ld-2.5.so
00002b335c594000     520 r-x-- 0000000000000000 008:00003 libm-2.5.so
00002b335c616000    2044 ----- 0000000000082000 008:00003 libm-2.5.so
00002b335c815000       4 r---- 0000000000081000 008:00003 libm-2.5.so
00002b335c816000       4 rw--- 0000000000082000 008:00003 libm-2.5.so
00002b335c817000     108 r-x-- 0000000000000000 008:00003 libpcre.so.0.0.1
00002b335c832000    2048 ----- 000000000001b000 008:00003 libpcre.so.0.0.1
00002b335ca32000       4 rw--- 000000000001b000 008:00003 libpcre.so.0.0.1
00002b335ca33000      84 r-x-- 0000000000000000 008:00003 libselinux.so.1
00002b335ca48000    2048 ----- 0000000000015000 008:00003 libselinux.so.1
00002b335cc48000       8 rw--- 0000000000015000 008:00003 libselinux.so.1
00002b335cc4a000       8 rw--- 00002b335cc4a000 000:00000   [ anon ]
00002b335cc4c000     112 r-x-- 0000000000000000 008:00005 libaprutil-1.so.0.2.7
00002b335cc68000    2044 ----- 000000000001c000 008:00005 libaprutil-1.so.0.2.7
00002b335ce67000       8 rw--- 000000000001b000 008:00005 libaprutil-1.so.0.2.7
00002b335ce69000      36 r-x-- 0000000000000000 008:00003 libcrypt-2.5.so
00002b335ce72000    2044 ----- 0000000000009000 008:00003 libcrypt-2.5.so
00002b335d071000       4 r---- 0000000000008000 008:00003 libcrypt-2.5.so
00002b335d072000       4 rw--- 0000000000009000 008:00003 libcrypt-2.5.so
00002b335d073000     184 rw--- 00002b335d073000 000:00000   [ anon ]
00002b335d0a1000     224 r-x-- 0000000000000000 008:00005 libldap-2.3.so.0.2.31
00002b335d0d9000    2048 ----- 0000000000038000 008:00005 libldap-2.3.so.0.2.31
00002b335d2d9000       8 rw--- 0000000000038000 008:00005 libldap-2.3.so.0.2.31
00002b335d2db000       4 rw--- 00002b335d2db000 000:00000   [ anon ]
00002b335d2dc000      52 r-x-- 0000000000000000 008:00005 liblber-2.3.so.0.2.31
00002b335d2e9000    2048 ----- 000000000000d000 008:00005 liblber-2.3.so.0.2.31
00002b335d4e9000       4 rw--- 000000000000d000 008:00005 liblber-2.3.so.0.2.31
00002b335d4ea000     964 r-x-- 0000000000000000 008:00003 libdb-4.3.so
00002b335d5db000    2044 ----- 00000000000f1000 008:00003 libdb-4.3.so
00002b335d7da000      20 rw--- 00000000000f0000 008:00003 libdb-4.3.so
00002b335d7df000     128 r-x-- 0000000000000000 008:00003 libexpat.so.0.5.0
00002b335d7ff000    2044 ----- 0000000000020000 008:00003 libexpat.so.0.5.0
00002b335d9fe000      12 rw--- 000000000001f000 008:00003 libexpat.so.0.5.0
00002b335da01000       4 rw--- 00002b335da01000 000:00000   [ anon ]
00002b335da02000     152 r-x-- 0000000000000000 008:00005 libapr-1.so.0.2.7
00002b335da28000    2048 ----- 0000000000026000 008:00005 libapr-1.so.0.2.7
00002b335dc28000       4 rw--- 0000000000026000 008:00005 libapr-1.so.0.2.7
00002b335dc29000      88 r-x-- 0000000000000000 008:00003 libpthread-2.5.so
00002b335dc3f000    2044 ----- 0000000000016000 008:00003 libpthread-2.5.so
00002b335de3e000       4 r---- 0000000000015000 008:00003 libpthread-2.5.so
00002b335de3f000       4 rw--- 0000000000016000 008:00003 libpthread-2.5.so
00002b335de40000      16 rw--- 00002b335de40000 000:00000   [ anon ]
00002b335de44000       8 r-x-- 0000000000000000 008:00003 libdl-2.5.so
00002b335de46000    2048 ----- 0000000000002000 008:00003 libdl-2.5.so
00002b335e046000       4 r---- 0000000000002000 008:00003 libdl-2.5.so
00002b335e047000       4 rw--- 0000000000003000 008:00003 libdl-2.5.so
00002b335e048000       4 rw--- 00002b335e048000 000:00000   [ anon ]
00002b335e049000    1328 r-x-- 0000000000000000 008:00003 libc-2.5.so
00002b335e195000    2048 ----- 000000000014c000 008:00003 libc-2.5.so
00002b335e395000      16 r---- 000000000014c000 008:00003 libc-2.5.so
00002b335e399000       4 rw--- 0000000000150000 008:00003 libc-2.5.so
00002b335e39a000      20 rw--- 00002b335e39a000 000:00000   [ anon ]
00002b335e39f000     236 r-x-- 0000000000000000 008:00003 libsepol.so.1
00002b335e3da000    2048 ----- 000000000003b000 008:00003 libsepol.so.1
00002b335e5da000       4 rw--- 000000000003b000 008:00003 libsepol.so.1
00002b335e5db000      40 rw--- 00002b335e5db000 000:00000   [ anon ]
00002b335e5e5000      12 r-x-- 0000000000000000 008:00003 libuuid.so.1.2
00002b335e5e8000    2048 ----- 0000000000003000 008:00003 libuuid.so.1.2
00002b335e7e8000       4 rw--- 0000000000003000 008:00003 libuuid.so.1.2
00002b335e7e9000       4 rw--- 00002b335e7e9000 000:00000   [ anon ]
00002b335e7ea000     128 r-x-- 0000000000000000 008:00005 libpq.so.4.1
00002b335e80a000    2048 ----- 0000000000020000 008:00005 libpq.so.4.1
00002b335ea0a000       8 rw--- 0000000000020000 008:00005 libpq.so.4.1
00002b335ea0c000     352 r-x-- 0000000000000000 008:00005 libsqlite3.so.0.8.6
00002b335ea64000    2048 ----- 0000000000058000 008:00005 libsqlite3.so.0.8.6
00002b335ec64000       8 rw--- 0000000000058000 008:00005 libsqlite3.so.0.8.6
00002b335ec66000      68 r-x-- 0000000000000000 008:00003 libresolv-2.5.so
00002b335ec77000    2048 ----- 0000000000011000 008:00003 libresolv-2.5.so
00002b335ee77000       4 r---- 0000000000011000 008:00003 libresolv-2.5.so
00002b335ee78000       4 rw--- 0000000000012000 008:00003 libresolv-2.5.so
00002b335ee79000      12 rw--- 00002b335ee79000 000:00000   [ anon ]
00002b335ee7c000      96 r-x-- 0000000000000000 008:00005 libsasl2.so.2.0.22
00002b335ee94000    2048 ----- 0000000000018000 008:00005 libsasl2.so.2.0.22
00002b335f094000       4 rw--- 0000000000018000 008:00005 libsasl2.so.2.0.22
00002b335f095000     272 r-x-- 0000000000000000 008:00003 libssl.so.0.9.8e
00002b335f0d9000    2048 ----- 0000000000044000 008:00003 libssl.so.0.9.8e
00002b335f2d9000      24 rw--- 0000000000044000 008:00003 libssl.so.0.9.8e
00002b335f2df000    1204 r-x-- 0000000000000000 008:00003 libcrypto.so.0.9.8e
00002b335f40c000    2044 ----- 000000000012d000 008:00003 libcrypto.so.0.9.8e
00002b335f60b000     132 rw--- 000000000012c000 008:00003 libcrypto.so.0.9.8e
00002b335f62c000      20 rw--- 00002b335f62c000 000:00000   [ anon ]
00002b335f631000     580 r-x-- 0000000000000000 008:00005 libkrb5.so.3.3
00002b335f6c2000    2048 ----- 0000000000091000 008:00005 libkrb5.so.3.3
00002b335f8c2000      16 rw--- 0000000000091000 008:00005 libkrb5.so.3.3
00002b335f8c6000      84 r-x-- 0000000000000000 008:00003 libnsl-2.5.so
00002b335f8db000    2044 ----- 0000000000015000 008:00003 libnsl-2.5.so
00002b335fada000       4 r---- 0000000000014000 008:00003 libnsl-2.5.so
00002b335fadb000       4 rw--- 0000000000015000 008:00003 libnsl-2.5.so
00002b335fadc000      12 rw--- 00002b335fadc000 000:00000   [ anon ]
00002b335fadf000     176 r-x-- 0000000000000000 008:00005 libgssapi_krb5.so.2.2
00002b335fb0b000    2048 ----- 000000000002c000 008:00005 libgssapi_krb5.so.2.2
00002b335fd0b000       8 rw--- 000000000002c000 008:00005 libgssapi_krb5.so.2.2
00002b335fd0d000       8 r-x-- 0000000000000000 008:00003 libcom_err.so.2.1
00002b335fd0f000    2044 ----- 0000000000002000 008:00003 libcom_err.so.2.1
00002b335ff0e000       4 rw--- 0000000000001000 008:00003 libcom_err.so.2.1
00002b335ff0f000     144 r-x-- 0000000000000000 008:00005 libk5crypto.so.3.1
00002b335ff33000    2044 ----- 0000000000024000 008:00005 libk5crypto.so.3.1
00002b3360132000       8 rw--- 0000000000023000 008:00005 libk5crypto.so.3.1
00002b3360134000       4 rw--- 00002b3360134000 000:00000   [ anon ]
00002b3360135000      80 r-x-- 0000000000000000 008:00005 libz.so.1.2.3
00002b3360149000    2044 ----- 0000000000014000 008:00005 libz.so.1.2.3
00002b3360348000       4 rw--- 0000000000013000 008:00005 libz.so.1.2.3
00002b3360349000      32 r-x-- 0000000000000000 008:00005 libkrb5support.so.0.1
00002b3360351000    2044 ----- 0000000000008000 008:00005 libkrb5support.so.0.1
00002b3360550000       4 rw--- 0000000000007000 008:00005 libkrb5support.so.0.1
00002b3360551000       8 r-x-- 0000000000000000 008:00003 libkeyutils-1.2.so
00002b3360553000    2044 ----- 0000000000002000 008:00003 libkeyutils-1.2.so
00002b3360752000       4 rw--- 0000000000001000 008:00003 libkeyutils-1.2.so
00002b3360753000      12 rw--- 00002b3360753000 000:00000   [ anon ]
00002b3360756000       8 r-x-- 0000000000000000 008:00005 mod_auth_basic.so
00002b3360758000    2044 ----- 0000000000002000 008:00005 mod_auth_basic.so
00002b3360957000       8 rw--- 0000000000001000 008:00005 mod_auth_basic.so
00002b3360959000       8 r-x-- 0000000000000000 008:00005 mod_authn_file.so
00002b336095b000    2044 ----- 0000000000002000 008:00005 mod_authn_file.so
00002b3360b5a000       8 rw--- 0000000000001000 008:00005 mod_authn_file.so
00002b3360b5c000       4 r-x-- 0000000000000000 008:00005 mod_authn_default.so
00002b3360b5d000    2044 ----- 0000000000001000 008:00005 mod_authn_default.so
00002b3360d5c000       8 rw--- 0000000000000000 008:00005 mod_authn_default.so
00002b3360d5e000       8 r-x-- 0000000000000000 008:00005 mod_authz_host.so
00002b3360d60000    2044 ----- 0000000000002000 008:00005 mod_authz_host.so
00002b3360f5f000       8 rw--- 0000000000001000 008:00005 mod_authz_host.so
00002b3360f61000       4 r-x-- 0000000000000000 008:00005 mod_authz_user.so
00002b3360f62000    2044 ----- 0000000000001000 008:00005 mod_authz_user.so
00002b3361161000       8 rw--- 0000000000000000 008:00005 mod_authz_user.so
00002b3361163000       4 r-x-- 0000000000000000 008:00005 mod_authz_default.so
00002b3361164000    2044 ----- 0000000000001000 008:00005 mod_authz_default.so
00002b3361363000       8 rw--- 0000000000000000 008:00005 mod_authz_default.so
00002b3361365000      36 r-x-- 0000000000000000 008:00005 mod_include.so
00002b336136e000    2048 ----- 0000000000009000 008:00005 mod_include.so
00002b336156e000       8 rw--- 0000000000009000 008:00005 mod_include.so
00002b3361570000      20 r-x-- 0000000000000000 008:00005 mod_log_config.so
00002b3361575000    2044 ----- 0000000000005000 008:00005 mod_log_config.so
00002b3361774000       8 rw--- 0000000000004000 008:00005 mod_log_config.so
00002b3361776000       8 r-x-- 0000000000000000 008:00005 mod_logio.so
00002b3361778000    2044 ----- 0000000000002000 008:00005 mod_logio.so
00002b3361977000       8 rw--- 0000000000001000 008:00005 mod_logio.so
00002b3361979000       4 r-x-- 0000000000000000 008:00005 mod_env.so
00002b336197a000    2048 ----- 0000000000001000 008:00005 mod_env.so
00002b3361b7a000       8 rw--- 0000000000001000 008:00005 mod_env.so
00002b3361b7c000       8 r-x-- 0000000000000000 008:00005 mod_expires.so
00002b3361b7e000    2044 ----- 0000000000002000 008:00005 mod_expires.so
00002b3361d7d000       8 rw--- 0000000000001000 008:00005 mod_expires.so
00002b3361d7f000      12 r-x-- 0000000000000000 008:00005 mod_headers.so
00002b3361d82000    2048 ----- 0000000000003000 008:00005 mod_headers.so
00002b3361f82000       8 rw--- 0000000000003000 008:00005 mod_headers.so
00002b3361f84000       8 r-x-- 0000000000000000 008:00005 mod_setenvif.so
00002b3361f86000    2048 ----- 0000000000002000 008:00005 mod_setenvif.so
00002b3362186000       8 rw--- 0000000000002000 008:00005 mod_setenvif.so
00002b3362188000      16 r-x-- 0000000000000000 008:00005 mod_mime.so
00002b336218c000    2044 ----- 0000000000004000 008:00005 mod_mime.so
00002b336238b000       8 rw--- 0000000000003000 008:00005 mod_mime.so
00002b336238d000      16 r-x-- 0000000000000000 008:00005 mod_status.so
00002b3362391000    2044 ----- 0000000000004000 008:00005 mod_status.so
00002b3362590000       8 rw--- 0000000000003000 008:00005 mod_status.so
00002b3362592000       8 r-x-- 0000000000000000 008:00005 mod_dir.so
00002b3362594000    2044 ----- 0000000000002000 008:00005 mod_dir.so
00002b3362793000       8 rw--- 0000000000001000 008:00005 mod_dir.so
00002b3362795000      12 r-x-- 0000000000000000 008:00005 mod_alias.so
00002b3362798000    2044 ----- 0000000000003000 008:00005 mod_alias.so
00002b3362997000       8 rw--- 0000000000002000 008:00005 mod_alias.so
00002b3362999000      56 r-x-- 0000000000000000 008:00005 mod_rewrite.so
00002b33629a7000    2044 ----- 000000000000e000 008:00005 mod_rewrite.so
00002b3362ba6000       8 rw--- 000000000000d000 008:00005 mod_rewrite.so
00002b3362ba8000      16 r-x-- 0000000000000000 008:00005 mod_filemtime.so
00002b3362bac000    2048 ----- 0000000000004000 008:00005 mod_filemtime.so
00002b3362dac000       4 rw--- 0000000000004000 008:00005 mod_filemtime.so
00002b3362dad000     268 r-x-- 0000000000000000 008:00005 mod_security2.so
00002b3362df0000    2048 ----- 0000000000043000 008:00005 mod_security2.so
00002b3362ff0000      16 rw--- 0000000000043000 008:00005 mod_security2.so
00002b3362ffb000    1228 r-x-- 0000000000000000 008:00005 libxml2.so.2.6.26
00002b336312e000    2048 ----- 0000000000133000 008:00005 libxml2.so.2.6.26
00002b336332e000      36 rw--- 0000000000133000 008:00005 libxml2.so.2.6.26
00002b3363337000       4 rw--- 00002b3363337000 000:00000   [ anon ]
00002b3363338000     160 r-x-- 0000000000000000 008:00005 liblua-5.1.so
00002b3363360000    2048 ----- 0000000000028000 008:00005 liblua-5.1.so
00002b3363560000       8 rw--- 0000000000028000 008:00005 liblua-5.1.so
00002b3363562000    1024 rw--- 00002b3363562000 000:00000   [ anon ]
00002b3363712000     540 rw--- 00002b3363712000 000:00000   [ anon ]
00002b3363799000       8 r-x-- 0000000000000000 008:00005 mod_unique_id.so
00002b336379b000    2044 ----- 0000000000002000 008:00005 mod_unique_id.so
00002b336399a000       8 rw--- 0000000000001000 008:00005 mod_unique_id.so
00002b336399c000    1024 rw--- 00002b336399c000 000:00000   [ anon ]
00002b3363a9c000    3484 r-x-- 0000000000000000 008:00007 libphp5.so
00002b3363e03000    2048 ----- 0000000000367000 008:00007 libphp5.so
00002b3364003000     316 rw--- 0000000000367000 008:00007 libphp5.so
00002b3364052000      28 rw--- 00002b3364052000 000:00000   [ anon ]
00002b3364060000     224 r-x-- 0000000000000000 008:00005 libgmp.so.3.3.3
00002b3364098000    2048 ----- 0000000000038000 008:00005 libgmp.so.3.3.3
00002b3364298000       4 rw--- 0000000000038000 008:00005 libgmp.so.3.3.3
00002b3364299000     236 r-x-- 0000000000000000 008:00005 libcurl.so.3.0.0
00002b33642d4000    2048 ----- 000000000003b000 008:00005 libcurl.so.3.0.0
00002b33644d4000       8 rw--- 000000000003b000 008:00005 libcurl.so.3.0.0
00002b33644d6000      60 r-x-- 0000000000000000 008:00005 libbz2.so.1.0.3
00002b33644e5000    2044 ----- 000000000000f000 008:00005 libbz2.so.1.0.3
00002b33646e4000       8 rw--- 000000000000e000 008:00005 libbz2.so.1.0.3
00002b33646e6000     196 r-x-- 0000000000000000 008:00005 libidn.so.11.5.19
00002b3364717000    2044 ----- 0000000000031000 008:00005 libidn.so.11.5.19
00002b3364916000       4 rw--- 0000000000030000 008:00005 libidn.so.11.5.19
00002b3364917000   18476 r-x-- 0000000000000000 008:00007 libclntsh.so.10.1
00002b3365b22000    1020 ----- 000000000120b000 008:00007 libclntsh.so.10.1
00002b3365c21000     656 rw--- 000000000120a000 008:00007 libclntsh.so.10.1
00002b3365cc5000     112 rw--- 00002b3365cc5000 000:00000   [ anon ]
00002b3365ce1000    3004 r-x-- 0000000000000000 008:00007 libnnz10.so
00002b3365fd0000    1020 ----- 00000000002ef000 008:00007 libnnz10.so
00002b33660cf000     708 rw--- 00000000002ee000 008:00007 libnnz10.so
00002b3366180000       4 rw--- 00002b3366180000 000:00000   [ anon ]
00002b3366181000     160 r-x-- 0000000000000000 008:00005 mod_ssl.so
00002b33661a9000    2048 ----- 0000000000028000 008:00005 mod_ssl.so
00002b33663a9000       8 rw--- 0000000000028000 008:00005 mod_ssl.so
00002b33663ab000       8 rw--- 00002b33663ab000 000:00000   [ anon ]
00002b33663b4000      16 r-x-- 0000000000000000 008:00005 libdistcache.so.1.0.1
00002b33663b8000    2044 ----- 0000000000004000 008:00005 libdistcache.so.1.0.1
00002b33665b7000       4 rw--- 0000000000003000 008:00005 libdistcache.so.1.0.1
00002b33665b8000      32 r-x-- 0000000000000000 008:00005 libnal.so.1.0.1
00002b33665c0000    2048 ----- 0000000000008000 008:00005 libnal.so.1.0.1
00002b33667c0000       4 rw--- 0000000000008000 008:00005 libnal.so.1.0.1
00002b33667c1000   10240 rw--- 00002b33667c1000 000:00000   [ anon ]
00002b33671c1000     212 r--s- 0000000000000000 008:00008 passwd
00002b33671f6000     212 r--s- 0000000000000000 008:00008 group
00002b336722b000    6144 rw--- 00002b336722b000 000:00000   [ anon ]
00002b336782b000     212 r--s- 0000000000000000 008:00008 hosts
00002b3367860000    1024 rw--- 00002b3367860000 000:00000   [ anon ]
00002b3367960000   55096 r---- 0000000000000000 008:00005 locale-archive
00002b336af2e000    1024 rw--- 00002b336af2e000 000:00000   [ anon ]
00002b336b02e000      84 r-x-- 0000000000000000 008:00007 apc.so
00002b336b043000    2048 ----- 0000000000015000 008:00007 apc.so
00002b336b243000       8 rw--- 0000000000015000 008:00007 apc.so
00002b336b245000      32 rw--- 00002b336b245000 000:00000   [ anon ]
00002b336b254000      28 r-x-- 0000000000000000 008:00003 librt-2.5.so
00002b336b25b000    2048 ----- 0000000000007000 008:00003 librt-2.5.so
00002b336b45b000       4 r---- 0000000000007000 008:00003 librt-2.5.so
00002b336b45c000       4 rw--- 0000000000008000 008:00003 librt-2.5.so
00002b336b45d000      32 r-x-- 0000000000000000 008:00007 bcmath.so
00002b336b465000    2048 ----- 0000000000008000 008:00007 bcmath.so
00002b336b665000       4 rw--- 0000000000008000 008:00007 bcmath.so
00002b336b666000     156 r-x-- 0000000000000000 008:00007 dom.so
00002b336b68d000    2044 ----- 0000000000027000 008:00007 dom.so
00002b336b88c000      24 rw--- 0000000000026000 008:00007 dom.so
00002b336b892000       4 rw--- 00002b336b892000 000:00000   [ anon ]
00002b336b893000     336 r-x-- 0000000000000000 008:00007 gd.so
00002b336b8e7000    2044 ----- 0000000000054000 008:00007 gd.so
00002b336bae6000      28 rw--- 0000000000053000 008:00007 gd.so
00002b336baed000      16 rw--- 00002b336baed000 000:00000   [ anon ]
00002b336baf8000     520 r-x-- 0000000000000000 008:00005 libfreetype.so.6.3.10
00002b336bb7a000    2048 ----- 0000000000082000 008:00005 libfreetype.so.6.3.10
00002b336bd7a000      20 rw--- 0000000000082000 008:00005 libfreetype.so.6.3.10
00002b336bd7f000    1044 r-x-- 0000000000000000 008:00005 libX11.so.6.2.0
00002b336be84000    2048 ----- 0000000000105000 008:00005 libX11.so.6.2.0
00002b336c084000      28 rw--- 0000000000105000 008:00005 libX11.so.6.2.0
00002b336c08b000      64 r-x-- 0000000000000000 008:00005 libXpm.so.4.11.0
00002b336c09b000    2048 ----- 0000000000010000 008:00005 libXpm.so.4.11.0
00002b336c29b000       4 rw--- 0000000000010000 008:00005 libXpm.so.4.11.0
00002b336c29c000     140 r-x-- 0000000000000000 008:00005 libpng12.so.0.10.0
00002b336c2bf000    2048 ----- 0000000000023000 008:00005 libpng12.so.0.10.0
00002b336c4bf000       4 rw--- 0000000000023000 008:00005 libpng12.so.0.10.0
00002b336c4c0000     132 r-x-- 0000000000000000 008:00005 libjpeg.so.62.0.0
00002b336c4e1000    2044 ----- 0000000000021000 008:00005 libjpeg.so.62.0.0
00002b336c6e0000       4 rw--- 0000000000020000 008:00005 libjpeg.so.62.0.0
00002b336c6e1000       8 r-x-- 0000000000000000 008:00005 libXau.so.6.0.0
00002b336c6e3000    2044 ----- 0000000000002000 008:00005 libXau.so.6.0.0
00002b336c8e2000       4 rw--- 0000000000001000 008:00005 libXau.so.6.0.0
00002b336c8e3000      20 r-x-- 0000000000000000 008:00005 libXdmcp.so.6.0.0
00002b336c8e8000    2044 ----- 0000000000005000 008:00005 libXdmcp.so.6.0.0
00002b336cae7000       4 rw--- 0000000000004000 008:00005 libXdmcp.so.6.0.0
00002b336cae8000      72 r-x-- 0000000000000000 008:00007 imagick0-gm.so
00002b336cafa000    2044 ----- 0000000000012000 008:00007 imagick0-gm.so
00002b336ccf9000       8 rw--- 0000000000011000 008:00007 imagick0-gm.so
00002b336ccfb000     156 r-x-- 0000000000000000 008:00005 libGraphicsMagickWand.so.0.0.4
00002b336cd22000    2044 ----- 0000000000027000 008:00005 libGraphicsMagickWand.so.0.0.4
00002b336cf21000       4 rw--- 0000000000026000 008:00005 libGraphicsMagickWand.so.0.0.4
00002b336cf22000    1724 r-x-- 0000000000000000 008:00005 libGraphicsMagick.so.1.0.15
00002b336d0d1000    2048 ----- 00000000001af000 008:00005 libGraphicsMagick.so.1.0.15
00002b336d2d1000     332 rw--- 00000000001af000 008:00005 libGraphicsMagick.so.1.0.15
00002b336d324000       4 rw--- 00002b336d324000 000:00000   [ anon ]
00002b336d325000      28 r-x-- 0000000000000000 008:00007 json.so
00002b336d32c000    2044 ----- 0000000000007000 008:00007 json.so
00002b336d52b000       4 rw--- 0000000000006000 008:00007 json.so
00002b336d52c000      32 r-x-- 0000000000000000 008:00007 mcrypt.so
00002b336d534000    2048 ----- 0000000000008000 008:00007 mcrypt.so
00002b336d734000       4 rw--- 0000000000008000 008:00007 mcrypt.so
00002b336d73c000     164 r-x-- 0000000000000000 008:00005 libmcrypt.so.4.4.8
00002b336d765000    2044 ----- 0000000000029000 008:00005 libmcrypt.so.4.4.8
00002b336d964000      12 rw--- 0000000000028000 008:00005 libmcrypt.so.4.4.8
00002b336d967000      24 rw--- 00002b336d967000 000:00000   [ anon ]
00002b336d96d000      88 r-x-- 0000000000000000 008:00007 memcache.so
00002b336d983000    2044 ----- 0000000000016000 008:00007 memcache.so
00002b336db82000       8 rw--- 0000000000015000 008:00007 memcache.so
00002b336db84000       8 r-x-- 0000000000000000 008:00007 mhash.so
00002b336db86000    2044 ----- 0000000000002000 008:00007 mhash.so
00002b336dd85000       4 rw--- 0000000000001000 008:00007 mhash.so
00002b336dd8d000     176 r-x-- 0000000000000000 008:00005 libmhash.so.2.0.1
00002b336ddb9000    2044 ----- 000000000002c000 008:00005 libmhash.so.2.0.1
00002b336dfb8000       4 rw--- 000000000002b000 008:00005 libmhash.so.2.0.1
00002b336dfb9000      44 r-x-- 0000000000000000 008:00007 mysql.so
00002b336dfc4000    2044 ----- 000000000000b000 008:00007 mysql.so
00002b336e1c3000       8 rw--- 000000000000a000 008:00007 mysql.so
00002b336e1cc000    1192 r-x-- 0000000000000000 008:00005 libmysqlclient.so.15.0.0
00002b336e2f6000    2048 ----- 000000000012a000 008:00005 libmysqlclient.so.15.0.0
00002b336e4f6000     284 rw--- 000000000012a000 008:00005 libmysqlclient.so.15.0.0
00002b336e53d000       4 rw--- 00002b336e53d000 000:00000   [ anon ]
00002b336e53e000     104 r-x-- 0000000000000000 008:00007 mysqli.so
00002b336e558000    2044 ----- 000000000001a000 008:00007 mysqli.so
00002b336e757000      12 rw--- 0000000000019000 008:00007 mysqli.so
00002b336e75a000       4 rw--- 00002b336e75a000 000:00000   [ anon ]
00002b336e75b000      88 r-x-- 0000000000000000 008:00007 pdo.so
00002b336e771000    2048 ----- 0000000000016000 008:00007 pdo.so
00002b336e971000      12 rw--- 0000000000016000 008:00007 pdo.so
00002b336e974000      24 r-x-- 0000000000000000 008:00007 pdo_mysql.so
00002b336e97a000    2048 ----- 0000000000006000 008:00007 pdo_mysql.so
00002b336eb7a000       4 rw--- 0000000000006000 008:00007 pdo_mysql.so
00002b336eb7b000      24 r-x-- 0000000000000000 008:00007 pdo_oci.so
00002b336eb81000    2048 ----- 0000000000006000 008:00007 pdo_oci.so
00002b336ed81000       4 rw--- 0000000000006000 008:00007 pdo_oci.so
00002b336ed82000     296 r-x-- 0000000000000000 008:00007 soap.so
00002b336edcc000    2048 ----- 000000000004a000 008:00007 soap.so
00002b336efcc000      12 rw--- 000000000004a000 008:00007 soap.so
00002b336efcf000     128 r-x-- 0000000000000000 008:00007 suhosin.so
00002b336efef000    2048 ----- 0000000000020000 008:00007 suhosin.so
00002b336f1ef000      24 rw--- 0000000000020000 008:00007 suhosin.so
00002b336f1f5000       8 rw--- 00002b336f1f5000 000:00000   [ anon ]
00002b336f1f7000      28 r-x-- 0000000000000000 008:00007 xmlreader.so
00002b336f1fe000    2044 ----- 0000000000007000 008:00007 xmlreader.so
00002b336f3fd000       8 rw--- 0000000000006000 008:00007 xmlreader.so
00002b336f3ff000      28 r-x-- 0000000000000000 008:00007 xmlwriter.so
00002b336f406000    2044 ----- 0000000000007000 008:00007 xmlwriter.so
00002b336f605000       8 rw--- 0000000000006000 008:00007 xmlwriter.so
00002b336f607000      28 r-x-- 0000000000000000 008:00007 xsl.so
00002b336f60e000    2044 ----- 0000000000007000 008:00007 xsl.so
00002b336f80d000       4 rw--- 0000000000006000 008:00007 xsl.so
00002b336f815000      68 r-x-- 0000000000000000 008:00005 libexslt.so.0.8.13
00002b336f826000    2048 ----- 0000000000011000 008:00005 libexslt.so.0.8.13
00002b336fa26000       4 rw--- 0000000000011000 008:00005 libexslt.so.0.8.13
00002b336fa27000     208 r-x-- 0000000000000000 008:00005 libxslt.so.1.1.17
00002b336fa5b000    2044 ----- 0000000000034000 008:00005 libxslt.so.1.1.17
00002b336fc5a000       8 rw--- 0000000000033000 008:00005 libxslt.so.1.1.17
00002b336fc5c000     296 r-x-- 0000000000000000 008:00005 libgcrypt.so.11.2.3
00002b336fca6000    2048 ----- 000000000004a000 008:00005 libgcrypt.so.11.2.3
00002b336fea6000       8 rw--- 000000000004a000 008:00005 libgcrypt.so.11.2.3
00002b336fea8000       4 rw--- 00002b336fea8000 000:00000   [ anon ]
00002b336fea9000      12 r-x-- 0000000000000000 008:00005 libgpg-error.so.0.3.0
00002b336feac000    2044 ----- 0000000000003000 008:00005 libgpg-error.so.0.3.0
00002b33700ab000       4 rw--- 0000000000002000 008:00005 libgpg-error.so.0.3.0
00002b33700ac000      68 r-x-- 0000000000000000 008:00007 zip.so
00002b33700bd000    2044 ----- 0000000000011000 008:00007 zip.so
00002b33702bc000       8 rw--- 0000000000010000 008:00007 zip.so
00002b33702c5000      40 r-x-- 0000000000000000 008:00003 libnss_files-2.5.so
00002b33702cf000    2044 ----- 000000000000a000 008:00003 libnss_files-2.5.so
00002b33704ce000       4 r---- 0000000000009000 008:00003 libnss_files-2.5.so
00002b33704cf000       4 rw--- 000000000000a000 008:00003 libnss_files-2.5.so
00002b33704d0000    1024 rw--- 00002b33704d0000 000:00000   [ anon ]
00002b33705d0000  131072 rw-s- 0000000000000000 008:00006 apc.6D9fX9 (deleted)
00002b33785d0000   70948 r-x-- 0000000000000000 008:00007 libociei.so
00002b337cb19000    1020 ----- 0000000004549000 008:00007 libociei.so
00002b337cc18000       8 rw--- 0000000004548000 008:00007 libociei.so
00002b337cc1a000    1024 rw--- 00002b337cc1a000 000:00000   [ anon ]
00002b337cd1a000     504 rw-s- 0000000000000000 000:00009 zero (deleted)
00002b337cd98000    5120 rw--- 00002b337cd98000 000:00000   [ anon ]
00002b337d299000   48152 rw--- 00002b337d299000 000:00000   [ anon ]
00007fffc38f1000     200 rwx-- 00007ffffffcb000 000:00000   [ stack ]
00007fffc3923000       8 rw--- 00007fffffffd000 000:00000   [ anon ]
ffffffffff600000    8192 ----- 0000000000000000 000:00000   [ anon ]
mapped: 595780K    writeable/private: 82440K    shared: 132296K
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • douchenzhan3050 douchenzhan3050 12年前

    The APD and XDebug modules will let you track memory usage, they'll usually point you in the right direction, although I think that they can sometime be a little unreliable given PHP's garbage collection model. However, that said, it may point you in the right direction short of tracing memory_get_usage in a tick function.

    点赞 评论 复制链接分享