Failed to allocate memory - What is it trying to say?

Posted by asprin on Programmers See other posts from Programmers or by asprin
Published on 2014-06-12T08:14:37Z Indexed on 2014/06/12 9:39 UTC
Read the original article Hit count: 191

Filed under:
|

In my early days of programming I often used to get memory related fatal errors in the following format:

Fatal error: Allowed memory size of <some big number> bytes exhausted 
(tried to allocate <some small number> bytes) in /path/to/filename.php 
on line <some line number>

I'm a little embarrassed to state that even though I have figured out how to solve them and take steps to avoid them altogether, I'm still not quite sure what exactly does the message translate to in simple words.

For example, if I get a message such as:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4000 bytes) 
in ........ on line 34

As things stand at the moment, I assume it to be stating that the script consumes 67108864 bytes of data, but only 4000 bytes are available during runtime.

  • Am I right in my assumption?
  • If not, what's the correct interpretation?

© Programmers or respective owner

Related posts about php

Related posts about memory