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

Re: PHP and memory_limit



Hi Stan!
Thank you for your answer.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate
40000 bytes) in /Users/jonas/mem_test on line 20
Looks like you have a problem with OSX as well.  Your test failed at allocating
40 KB when 128 MB was available.  So, it's not failing at all on Debian, and
it's failing incorrectly on OSX.
PHP allocates memory in chunks until memory_limit has been exceeded. At the time the script stopped executing, it was trying to allocate another 40 kB and probably used about 127,96 MB already.
I'd say you should hit a PHP mailing list or IRC channel.  They'll likely know
this stuff better than anyone here.
This seems to be related to Debian since this works as expected in Ubuntu (don't know the version) with PHP 5.2.14 and on another unknown linux-box with PHP 5.3.5. I haven't been able to recreate the problem on a non-Debian box.
BTW, if you're going to be processing images, there's not way around consuming
memory, thus you'll just have many fail if you set the memory limit low.  That
doesn't get any work done.
The problem is that the processing doesn't fail. ;-) The thing is that the code isn't mine, but the server is and I'd like to make sure that the server cannot be abused like this.

Could you recreate the problem Stan? Or does the PHP code fail with an error if you run it on lenny or squeeze?

Regards, Jonas Mixter


Reply to: