Understanding memory_get_usage () and pmap

I am trying to understand the memory usage of some php processes. I tried using both get_memory_usage(), and so pmap, but the results seem to be disabled about one order of magnitude. I tried both with memory_get_usage()and memory_get_usage(true)as well memory_get_peak_usage(true), but even with memory_get_peak_usage(true)(the largest of all three varieties) there is still a lot of information about what is communicated via pmap.

More specifically, a call memory_get_peak_usage(true)every minute in my PHP script returns values ​​in the range from 1.75 MB to 3.5 MB, while a typical result pmap -d PIDgives something like:

...

b7839000       4 r---- 0000000000008000 0ca:00060 libcrypt-2.11.1.so
b783a000       4 rw--- 0000000000009000 0ca:00060 libcrypt-2.11.1.so
b783b000     156 rw--- 0000000000000000 000:00000   [ anon ]
b7864000       8 rw--- 0000000000000000 000:00000   [ anon ]
b7867000      12 r-x-- 0000000000000000 0ca:00060 libgpg-error.so.0.4.0
b786a000       4 r---- 0000000000002000 0ca:00060 libgpg-error.so.0.4.0
b786b000       4 rw--- 0000000000003000 0ca:00060 libgpg-error.so.0.4.0
b786c000       4 r---- 0000000000000000 000:00000   [ anon ]
b786d000      16 rw--- 0000000000000000 000:00000   [ anon ]
b7871000     108 r-x-- 0000000000000000 0ca:00060 ld-2.11.1.so
b788c000       4 r---- 000000000001a000 0ca:00060 ld-2.11.1.so
b788d000       4 rw--- 000000000001b000 0ca:00060 ld-2.11.1.so
bffc7000     136 rw--- 0000000000000000 000:00000   [ stack ]
f57fe000       4 r-x-- 0000000000000000 000:00000   [ anon ]
mapped: 32740K    writeable/private: 13116K    shared: 28K

, / , , . 13 , memory_get_peak_usage(true). - ?

+1
2

, memory_get_peak_usage() , script. PHP.

, PHP script.

, PHP, .

PHP , . ( php) , simplexml_load_string(), , , , , - . phpinfo(), , . PHP , PHP OPCODE, , . PHP, , .

, . GET/POST/FILES XML, .. .

- , . ( ) 9 7 apache.

, PHP. , PHP .

, . mysqli_*? xml_*? .. , PHP , :

Configure Command => './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql=mysqlnd' '--with-gd' '--enable-soap' '--with-libxml-dir=/usr/lib/' '--with-mysql-sock=/tmp' '--with-tidy' '--with-jpeg-dir=/usr/lib/' '--with-xsl' '--with-curl' '--with-zlib' '--enable-gd-native-ttf' '--with-openssl' '--with-mcrypt' '--with-pdo-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-bz2' '--enable-bcmath'

, PHP ./configure --disable-all ( ), , . libxml , soap, . tidy , . , ( ) , . PHP , . , , Bad Time.

+3

- 10. , 1.3 MBytes = 13MBits

0

All Articles