I am pulling down real estate properties from the Toronto Real Estate Board and I am using a LAMP stack with PHRETS on a 2GB Digital Ocean VPS. When I pull down the properties, I run some processes on them before saving them to a database. I have a cron job that runs the script every hour. Sometimes, the script runs flawlessly. Other times, I get this error, often within the first minute:
PHP Fatal error: Out of memory (allocated 131076096) (tried to allocate 12288 bytes) in /var/www/mysite.com/vendor/joshcam/mysqli-database-class/MysqliDb.php on line 1511
I've updated my php.ini
file with memory_limit = 1500M
I am quite new to all of this but I am under the impression this should allow a script to allocate 1500MB, or 1.5GB of memory.
The error seems to be saying that the script tried to allocate 12288 bytes
of a possible 131076096 bytes
, but that doesn't add up, does it? How can I fix this? Do I need to upgrade my server or should 2GB of RAM be enough? Is there something I am missing?