[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PHP and memory_limit



In <[🔎] 4D5136C9.3000608@jamtport.se>, Jonas Mixter wrote:
>--- Example output from Debian machines ---
># php ./mem_test
>PHP memory limit before imagecreatetruecolor(): 32M
>PHP memory usage before imagecreatetruecolor(): 58280 bytes
>Process memory usage before imagecreatetruecolor(): 6 MB
>
>Creating image... Will allocate ~300 MB of memory
>
>PHP memory limit after imagecreatetruecolor(): 32M
>PHP memory usage after imagecreatetruecolor(): 67064 bytes
>Process memory usage after imagecreatetruecolor(): 338 MB
>
>
>--- Example output from OS X ---
>$ php ./mem_test
>PHP memory limit before imagecreatetruecolor(): 128M
>PHP memory usage before imagecreatetruecolor(): 644976 bytes
>Process memory usage before imagecreatetruecolor(): 8 MB
>
>Creating image... Will allocate ~300 MB of memory
>
>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
>allocate 40000 bytes) in /Users/jonas/mem_test on line 20

I'd be interested to see what memory_get_peak_usage() returns after 
imagecreatetruecolor() is called on OSX.  I'm thinking perhaps that value is 
over 128M on OSX and it is that tracked memory that is being limited by PHP.

As far as the discrepancy between memory_get_peak_usage() and 
process_memory_get_usage(), that seems to occur on both OSes, so I'd ask in a 
PHP-specific forum.
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: