PHP Fatal error: allowed memory size - on a nonexistent line

I see this error on my working server, sometimes (I mean, it seems random, since my site is like decent traffic, and so far it only happened 5 times):

[21-Feb-2012 23:43:19 UTC] PHP Fatal error: the allowed memory size of 67108864 bytes has been exhausted (tried to allocate 261900 bytes) in /home/xxxxx/xxxxx/xxx.php on line 1811

The funny part: the file has only 798 lines , and this has never happened before. Perhaps this is due to recent changes made by me to my scripts, yes, but this error just does not make sense to me.

Please keep in mind that I know what the "Allowed memory size" error means, and I know how to increase the memory limit.
However, my question here is , why does PHP refer to a string that does not exist?
I do not know how to solve this problem, because for me it does not make sense.

Thanks.

+4
source share
1 answer

I just found what caused a memory leak.

This is a recent change that went into a recursion cycle between two functions, although it was a rare event.

Line 1811 is real, yes, but the file that referenced the error is invalid. Line 1811 was from another file (included in this section), where one of the functions is.

I still appreciate the help of people who have commented on this above.

+3
source

Source: https://habr.com/ru/post/1397697/


All Articles