Failed to allocate memory - What is it trying to say?
- by asprin
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?