Uzzini cik daudz atmiņas izmanto process / pmap

Lai uzzinātu cik atmiņu konkrēts process lieto, parasti lietojam top, kur rēķinam Shared Memory + mapped file + total virtual memory procesa lielums + Resident Set Size + non-swapped physical memory ko lieto process. savukārt tas aizņem laiku, to var izdarīt daudz vienkāršāk, ar ps atrodam nepieciešamās programmas pid, manā gadījumā es vēlos uzzināt cik atmiņu aizņem apache, rakstu konsolē ps auxf un meklēju master procesu, kurš darbojas zem lietotāja root (manā gadījumā tas ir 12404), pēc tam rakstu komandu pmap 12404 un iegūstu šādu rezultātu:

12404: /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -D CACHE -D SUEXEC -D PYTHON -D FCGID -D EVASIVE -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -E /var/log/apache2/startuperror.log -k start

08048000 304K r-x– /usr/sbin/apache2

08094000 12K rw— /usr/sbin/apache2

08097000 173920K rw— [ anon ]

b4e05000 28672K rw-s- /dev/zero (deleted)

b6a05000 40K r-x– /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/memcache.so

b6a0f000 4K r—- /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/memcache.so

b6a10000 4K rw— /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/memcache.so

b6a11000 44K r-x– /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/mailparse.so

b6a1c000 4K r—- /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/mailparse.so

b6a1d000 4K rw— /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/mailparse.so

b6a1e000 64K r-x– /usr/lib/libmagic.so.1.0.0

b6a2e000 4K rw— /usr/lib/libmagic.so.1.0.0

b6a38000 148K r-x– /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so

b6a5d000 4K r—- /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so

b6a5e000 4K rw— /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so

b6a5f000 940K r-x– /home/downloads/ioncube/ioncube_loader_lin_5.2.so

b6b4a000 20K rw— /home/downloads/ioncube/ioncube_loader_lin_5.2.so

b6b4f000 44K rw-s- /dev/zero (deleted)

b6b5a000 316K rw-s- /dev/zero (deleted)

b6ba9000 520K rw— [ anon ]

b6c2b000 32K r-x– /lib/libnss_files-2.6.1.so

b6c33000 4K r—- /lib/libnss_files-2.6.1.so

b6c34000 4K rw— /lib/libnss_files-2.6.1.so

b6c35000 32K r-x– /lib/libnss_nis-2.6.1.so

b6c3d000 4K r—- /lib/libnss_nis-2.6.1.so

b6c3e000 4K rw— /lib/libnss_nis-2.6.1.so

b6c3f000 24K r-x– /lib/libnss_compat-2.6.1.so

b6c45000 4K r—- /lib/libnss_compat-2.6.1.so

b6c46000 4K rw— /lib/libnss_compat-2.6.1.so

b6c47000 40K r-x– /usr/lib/libcares.so.1.0.0

b6c51000 4K rw— /usr/lib/libcares.so.1.0.0

b6c52000 12K r-x– /usr/lib/libgpg-error.so.0.3.1

b6c55000 4K rw— /usr/lib/libgpg-error.so.0.3.1

b6c56000 300K r-x– /usr/lib/libgcrypt.so.11.2.3

b6ca1000 8K rw— /usr/lib/libgcrypt.so.11.2.3

b6ca3000 1056K r-x– /usr/lib/libxml2.so.2.6.28

b6dab000 20K rw— /usr/lib/libxml2.so.2.6.28

b6db0000 4K rw— [ anon ]

b6db1000 180K r-x– /usr/lib/libxslt.so.1.1.20

b6dde000 4K rw— /usr/lib/libxslt.so.1.1.20

b6ddf000 540K r-x– /usr/lib/libnetsnmp.so.15.1.0

b6e66000 12K rw— /usr/lib/libnetsnmp.so.15.1.0

b6e69000 120K rw— [ anon ]

b6e87000 1108K r-x– /usr/lib/mysql/libmysqlclient.so.15.0.0

b6f9c000 268K rw— /usr/lib/mysql/libmysqlclient.so.15.0.0

b6fdf000 216K r-x– /usr/lib/libcurl.so.4.0.0

b7015000 4K rw— /usr/lib/libcurl.so.4.0.0

b7016000 56K r-x– /lib/libresolv-2.6.1.so

b7024000 4K r—- /lib/libresolv-2.6.1.so

b7025000 4K rw— /lib/libresolv-2.6.1.so

b7026000 8K rw— [ anon ]

b7028000 56K r-x– /lib/libbz2.so.1.0.4

b7036000 4K r—- /lib/libbz2.so.1.0.4

b7037000 4K rw— /lib/libbz2.so.1.0.4

b7038000 120K r-x– /usr/lib/libjpeg.so.62.0.0

b7056000 4K rw— /usr/lib/libjpeg.so.62.0.0

b7057000 132K r-x– /usr/lib/libpng12.so.0.22.0

b7078000 4K r—- /usr/lib/libpng12.so.0.22.0

b7079000 4K rw— /usr/lib/libpng12.so.0.22.0

b707a000 468K r-x– /usr/lib/libfreetype.so.6.3.15

b70ef000 16K rw— /usr/lib/libfreetype.so.6.3.15

b70f3000 228K r-x– /usr/lib/libt1.so.5.0.2

b712c000 12K rw— /usr/lib/libt1.so.5.0.2

b712f000 84K rw— [ anon ]

b7144000 28K r-x– /lib/libpam.so.0.78

b714b000 4K rw— /lib/libpam.so.0.78

b714c000 24K r-x– /usr/lib/libltdl.so.3.1.5

b7152000 4K rw— /usr/lib/libltdl.so.3.1.5

b7153000 144K r-x– /usr/lib/libmcrypt.so.4.4.8

b7177000 4K r—- /usr/lib/libmcrypt.so.4.4.8

b7178000 8K rw— /usr/lib/libmcrypt.so.4.4.8

b717a000 20K rw— [ anon ]

b717f000 256K r-x– /usr/lib/libmhash.so.2.0.1

b71bf000 4K r—- /usr/lib/libmhash.so.2.0.1

b71c0000 4K rw— /usr/lib/libmhash.so.2.0.1

b71c1000 8K r-x– /usr/lib/libpanel.so.5.6

b71c3000 4K rw— /usr/lib/libpanel.so.5.6

b71c4000 372K r-x– /usr/lib/libsqlite3.so.0.8.6

b7221000 8K rw— /usr/lib/libsqlite3.so.0.8.6

b7223000 220K r-x– /lib/libncurses.so.5.6

b725a000 32K rw— /lib/libncurses.so.5.6

b7262000 4K rw— [ anon ]

b7263000 164K r-x– /lib/libreadline.so.5.2

b728c000 16K rw— /lib/libreadline.so.5.2

b7290000 4K rw— [ anon ]

b7291000 24K r-x– /lib/libhistory.so.5.2

b7297000 4K rw— /lib/libhistory.so.5.2

b7298000 328K r-x– /usr/lib/libsqlite.so.0.8.6

b72ea000 12K rw— /usr/lib/libsqlite.so.0.8.6

b72ed000 256K r-x– /usr/lib/libtidy-0.99.so.0.0.0

b732d000 20K rw— /usr/lib/libtidy-0.99.so.0.0.0

b7332000 60K r-x– /usr/lib/libexslt.so.0.8.13

b7341000 4K rw— /usr/lib/libexslt.so.0.8.13

b7342000 6716K r-x– /usr/lib/apache2/modules/libphp5.so

b79d1000 4K r—- /usr/lib/apache2/modules/libphp5.so

b79d2000 164K rw— /usr/lib/apache2/modules/libphp5.so

b79fb000 44K rw— [ anon ]

b7a06000 56K r-x– /usr/lib/apache2/modules/mod_fcgid.so

b7a14000 4K rw— /usr/lib/apache2/modules/mod_fcgid.so

b7a15000 8K r-x– /lib/libutil-2.6.1.so

b7a17000 4K r—- /lib/libutil-2.6.1.so

b7a18000 4K rw— /lib/libutil-2.6.1.so

b7a1d000 12K r-x– /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/fileinfo.so

b7a20000 4K r—- /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/fileinfo.so

b7a21000 4K rw— /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/fileinfo.so

b7a22000 848K r-x– /usr/lib/apache2/modules/mod_python.so

b7af6000 144K rw— /usr/lib/apache2/modules/mod_python.so

b7b1a000 24K rw— [ anon ]

b7b20000 12K r-x– /usr/lib/apache2/modules/mod_evasive.so

b7b23000 4K rw— /usr/lib/apache2/modules/mod_evasive.so

b7b24000 36K r-x– /usr/lib/apache2/modules/mod_include.so

b7b2d000 4K rw— /usr/lib/apache2/modules/mod_include.so

b7b2e000 12K r-x– /usr/lib/apache2/modules/mod_deflate.so

b7b31000 4K rw— /usr/lib/apache2/modules/mod_deflate.so

b7b32000 16K r-x– /usr/lib/apache2/modules/mod_ext_filter.so

b7b36000 4K rw— /usr/lib/apache2/modules/mod_ext_filter.so

b7b37000 8K r-x– /usr/lib/apache2/modules/mod_dir.so

b7b39000 4K rw— /usr/lib/apache2/modules/mod_dir.so

b7b3a000 28K r-x– /usr/lib/apache2/modules/mod_autoindex.so

b7b41000 4K rw— /usr/lib/apache2/modules/mod_autoindex.so

b7b42000 4K r-x– /usr/lib/apache2/modules/mod_actions.so

b7b43000 4K rw— /usr/lib/apache2/modules/mod_actions.so

b7b44000 16K r-x– /usr/lib/apache2/modules/mod_status.so

b7b48000 4K rw— /usr/lib/apache2/modules/mod_status.so

b7b49000 12K r-x– /usr/lib/apache2/modules/mod_info.so

b7b4c000 4K rw— /usr/lib/apache2/modules/mod_info.so

b7b4d000 52K r-x– /usr/lib/apache2/modules/mod_rewrite.so

b7b5a000 4K rw— /usr/lib/apache2/modules/mod_rewrite.so

b7b5b000 8K r-x– /usr/lib/apache2/modules/mod_alias.so

b7b5d000 4K rw— /usr/lib/apache2/modules/mod_alias.so

b7b5e000 4K r-x– /usr/lib/apache2/modules/mod_suexec.so

b7b5f000 4K rw— /usr/lib/apache2/modules/mod_suexec.so

b7b60000 28K r-x– /usr/lib/apache2/modules/mod_cgid.so

b7b67000 4K rw— /usr/lib/apache2/modules/mod_cgid.so

b7b68000 20K r-x– /usr/lib/apache2/modules/mod_cgi.so

b7b6d000 4K rw— /usr/lib/apache2/modules/mod_cgi.so

b7b6e000 4K r-x– /usr/lib/apache2/modules/mod_logio.so

b7b6f000 4K rw— /usr/lib/apache2/modules/mod_logio.so

b7b70000 16K r-x– /usr/lib/apache2/modules/mod_log_config.so

b7b74000 4K rw— /usr/lib/apache2/modules/mod_log_config.so

b7b75000 8K r-x– /usr/lib/apache2/modules/mod_setenvif.so

b7b77000 4K rw— /usr/lib/apache2/modules/mod_setenvif.so

b7b78000 24K r-x– /usr/lib/apache2/modules/mod_negotiation.so

b7b7e000 4K rw— /usr/lib/apache2/modules/mod_negotiation.so

b7b7f000 12K r-x– /usr/lib/apache2/modules/mod_mime.so

b7b82000 4K rw— /usr/lib/apache2/modules/mod_mime.so

b7b83000 8K r-x– /usr/lib/apache2/modules/mod_headers.so

b7b85000 4K rw— /usr/lib/apache2/modules/mod_headers.so

b7b86000 8K r-x– /usr/lib/apache2/modules/mod_expires.so

b7b88000 4K rw— /usr/lib/apache2/modules/mod_expires.so

b7b89000 4K r-x– /usr/lib/apache2/modules/mod_env.so

b7b8a000 4K rw— /usr/lib/apache2/modules/mod_env.so

b7b8b000 12K r-x– /usr/lib/apache2/modules/mod_charset_lite.so

b7b8e000 4K rw— /usr/lib/apache2/modules/mod_charset_lite.so

b7b8f000 24K r-x– /usr/lib/apache2/modules/mod_auth_digest.so

b7b95000 4K rw— /usr/lib/apache2/modules/mod_auth_digest.so

b7b96000 8K r-x– /usr/lib/apache2/modules/mod_auth_dbm.so

b7b98000 4K rw— /usr/lib/apache2/modules/mod_auth_dbm.so

b7b99000 8K rw— [ anon ]

b7b9b000 1192K r-x– /lib/libc-2.6.1.so

b7cc5000 8K r—- /lib/libc-2.6.1.so

b7cc7000 4K rw— /lib/libc-2.6.1.so

b7cc8000 12K rw— [ anon ]

b7ccb000 8K r-x– /lib/libdl-2.6.1.so

b7ccd000 4K r—- /lib/libdl-2.6.1.so

b7cce000 4K rw— /lib/libdl-2.6.1.so

b7ccf000 76K r-x– /lib/libpthread-2.6.1.so

b7ce2000 4K r—- /lib/libpthread-2.6.1.so

b7ce3000 4K rw— /lib/libpthread-2.6.1.so

b7ce4000 8K rw— [ anon ]

b7ce6000 76K r-x– /lib/libnsl-2.6.1.so

b7cf9000 4K r—- /lib/libnsl-2.6.1.so

b7cfa000 4K rw— /lib/libnsl-2.6.1.so

b7cfb000 8K rw— [ anon ]

b7cfd000 20K r-x– /lib/libcrypt-2.6.1.so

b7d02000 4K r—- /lib/libcrypt-2.6.1.so

b7d03000 4K rw— /lib/libcrypt-2.6.1.so

b7d04000 156K rw— [ anon ]

b7d2b000 144K r-x– /lib/libm-2.6.1.so

b7d4f000 4K r—- /lib/libm-2.6.1.so

b7d50000 4K rw— /lib/libm-2.6.1.so

b7d51000 4K rw— [ anon ]

b7d52000 28K r-x– /lib/librt-2.6.1.so

b7d59000 4K r—- /lib/librt-2.6.1.so

b7d5a000 4K rw— /lib/librt-2.6.1.so

b7d5b000 116K r-x– /usr/lib/libapr-0.so.0.9.12

b7d78000 4K rw— /usr/lib/libapr-0.so.0.9.12

b7d79000 4K rw— [ anon ]

b7d7a000 116K r-x– /usr/lib/libexpat.so.1.5.2

b7d97000 8K rw— /usr/lib/libexpat.so.1.5.2

b7d99000 72K r-x– /usr/lib/libaprutil-0.so.0.9.12

b7dab000 4K rw— /usr/lib/libaprutil-0.so.0.9.12

b7dac000 1176K r-x– /usr/lib/libcrypto.so.0.9.8

b7ed2000 32K r—- /usr/lib/libcrypto.so.0.9.8

b7eda000 52K rw— /usr/lib/libcrypto.so.0.9.8

b7ee7000 16K rw— [ anon ]

b7eeb000 244K r-x– /usr/lib/libssl.so.0.9.8

b7f28000 4K r—- /usr/lib/libssl.so.0.9.8

b7f29000 12K rw— /usr/lib/libssl.so.0.9.8

b7f2c000 4K rw— [ anon ]

b7f2d000 68K r-x– /lib/libz.so.1.2.3

b7f3e000 4K rw— /lib/libz.so.1.2.3

b7f40000 4K r-x– /usr/lib/apache2/modules/mod_auth_anon.so

b7f41000 4K rw— /usr/lib/apache2/modules/mod_auth_anon.so

b7f42000 8K r-x– /usr/lib/apache2/modules/mod_auth.so

b7f44000 4K rw— /usr/lib/apache2/modules/mod_auth.so

b7f45000 8K r-x– /usr/lib/apache2/modules/mod_access.so

b7f47000 4K rw— /usr/lib/apache2/modules/mod_access.so

b7f48000 4K r-x– [ anon ]

b7f49000 104K r-x– /lib/ld-2.6.1.so

b7f63000 4K r—- /lib/ld-2.6.1.so

b7f64000 4K rw— /lib/ld-2.6.1.so

bfcf9000 80K rwx– [ stack ]

bfd0d000 8K rw— [ anon ]

total 224828K

txt fails te

tātad kopumā apache man izmanto 224 Mb atmiņas.

 
comments powered by Disqus