Reported via Issue Tracker Item #33711

When trying to insert a BLOB > 3MB in the database, the following error occurs:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4252768 bytes) in ...\libraries\joomla\database\driver.php on line 1638

Why is JDatabaseDriver->replacePrefix( ) eating so much memory?


There is basically nothing wrong with replacePrefix().

What actually happens is that you are sending to MySQL a string which is too large for a predefined setting (max_allowed_packet) and is reporting the error MySQL server has gone away, as explained in MySQL server has gone away obstructing import of large dumps.

Now, Joomla thinks this is just a temporary error, and retries the query, re-running the execute() method over and over again, till the memory runs out.

The solution to this issue is to increase the value of max_allowed_packet under [mysqld] in my.ini to a larger value.

  • 2
    Nice detective work! – Craig Jul 5 '14 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.