How is this even possible? PHP Memory Error -- allowed memory size bytes exhausted.

0

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1540673 bytes) in /home/appdev/glicious/Nutrition.php on line 41

If you haven't noticed, 1540673 is two orders of magnitude less than 134217728..

David Cowden

Posted 2012-06-18T04:40:56.077

Reputation: 189

Aren't PHP apps just getting rather hungry nowdays? php memory limit of 128M has been exceeded, need to figure if app has a memory leak or just needs the memory_limit bumped to 256M if it's the resource eater we're getting to know and love. – Fiasco Labs – 2012-06-18T05:22:40.260

Please choose a more appropriate title – slhck – 2012-06-18T08:02:37.223

1-1 for the title. How could anyone get an idea of what the post is about from reading that? Please make it easier for answerers, since they are the core of these sites. This might not be enforced as strictly on other forums, but that is not because it is OK in any way to have non-descriptive/misleading titles there either; they often just lack good moderation systems. – Daniel Andersson – 2012-06-18T08:21:41.647

@FiascoLabs I'm parsing a very large XML file and I have the memory so I figure I'll use it. I'll rewrite the script to parse it in segments in the future. Right now I just need it to work. – David Cowden – 2012-06-20T20:03:30.540

1@DanielAndersson Thanks for the downvote! (= The title made you read the question, didn't it? d= – David Cowden – 2012-06-20T20:04:10.727

Yes, but it also made me not answer the question and instead spend my time on speaking about how titles should be written ;-) . If it makes you and/or others take their time when writing their next title, maybe I or someone else will get some of that time back. But I also notice that the title still hasn't been changed, so maybe I'll be disappointed :-) . – Daniel Andersson – 2012-06-21T08:58:42.433

@DanielAndersson The question was already answered before you showed up -- no need to edit. Also, I thought I did a pretty good job of tagging the qustion. Besides, the guys over at Server-fault have a much better attitude: http://serverfault.com/questions/399661/how-is-this-even-possible-php-memory-error-allowed-memory-size-bytes-exhau they just edited the title for me (but I didn't think they did it justice to I imporved it though). It got the message across and did it in a constructive manner. Sorry for wasting your precious seconds..

– David Cowden – 2012-06-21T15:35:04.660

@DavidCowden: The point of these sites is to construct a database for future questioners, so we strive to keep the quality of the questions as high as possible. The title is essential for future search engines to be able to catalog the question. In this way, the next person with the same problem won't have to ask the same question again. For the sake of the sites - keep the quality high. – Daniel Andersson – 2012-06-21T15:57:11.473

@DanielAndersson I understand. I edited the title. – David Cowden – 2012-06-21T17:02:26.843

Answers

3

You are looking at it wrong. There is a total allowed memory size (134217728), an amount of currently allocated memory (unlisted), amount of last allocation (1540673).

The last allocation failed because the used amount plus the 1540673 is over the limit.

soandos

Posted 2012-06-18T04:40:56.077

Reputation: 22 744

Aaah okay thanks for clarifying that. The message is a bit misleading /= – David Cowden – 2012-06-18T05:07:03.633