This error message is being presented, any suggestions?
Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php
wordpress users add line:
@ini_set('memory_limit', '-1');
in wp-settings.php which you can find in the wordpress installed root folder
I hadn't renewed my hosting and the database was read-only. Joomla needed to write the session and couldn't do it.
It is unfortunately easy to program in PHP in a way that consumes memory faster than you realise. Copying strings, arrays and objects instead of using references will do it, though PHP 5 is supposed to do this more automatically than in PHP 4. But dealing with your data set in entirety over several steps is also wasteful compared to processing the smallest logical unit at a time. The classic example is working with large resultsets from a database: most programmers fetch the entire resultset into an array and then loop over it one or more times with foreach()
. It is much more memory efficient to use a while()
loop to fetch and process one row at a time. The same thing applies to processing a file.