1

I am getting these errors repeatedly in my logs

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes)

I don't get why it would die with memory size being much bigger then the bytes attempted to allocate!!

Kal
  • 948
  • 17
  • 30

1 Answers1

0

The error message tells you that a limit of 134217728 bytes (128 MB) was defined. This has already been used by your script, but it requested more. Allocating the next bytes (in your example: 20480) failed, that's why the script died.


To resolve this, you could either check why your script needs that memory (reducing the memory footprint can always be a good idea), or otherwise set a higher memory limit

Nico Haase
  • 11,420
  • 35
  • 43
  • 69
  • 1
    Don't think answers the question. I did increase the limit yet I got the same issue. `PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes)` – Kal Nov 02 '21 at 14:47
  • Yeah, now you are using a higher memory limit, but still exceed it – Nico Haase Nov 02 '21 at 14:48
  • I was using an open source library which kept crashing and running out of memory as described in this question. None of my error conditions appeared here on SO or elsewhere on Google. It turned out that the installed library was corrupted - I reinstalled the server and the software library - and all of the memory and other issues resolved themselves. – cloudxix Jun 25 '22 at 23:11