This may look like a duplicate but I did some research and tried them all. I'm still getting this error.
I changed the memory_limit to -1 and 536870912, and the result is the same.
I also used php -i to locate the php.ini to confirm if I am editing the correct file.
My guess is that you have some endless loop somewhere. Since it tries to allocate only 72 bytes and exhausts the 536870912 it looks like an endless loop.