The test site requires a lot of memory when viewing some category/archive pages.

I met with the following error messages yesterday:

Fatal error: Allowed memory size of
33554432 bytes exhausted (tried to
allocate 48 bytes) in
/var/www/t/wp-includes/load.php on
line 552

Fatal error: Allowed memory size of
209715200 bytes exhausted (tried to
allocate 40 bytes) in
/var/www/t/wp-includes/meta.php on
line 307

The problem was solved by adding the “define(‘WP_MEMORY_LIMIT’, ‘210M’);” line to the wp-config.php file.

But this is not good enough. The production site will have much more data than the test site, which means I have to add the “define(‘WP_MEMORY_LIMIT’, ‘2100M’);” line to the wp-config.php file. And 2100M may not be large enough as the time goes by.

How to decrease the memory consumption of the WordPress site dramatically? Any help is appreciated.

3 s
3

The WordPress Memory is something not easy to deal with. If the standard way is not helping (don’t rely on the WP_MEMORY_LIMIT constant, it’s conceptually broken, use ini_set in wp-config.php instead), then you can only throw hardware on it or hack the core.

Please check if you’re using a recent PHP version on your system. If that’s something with PHP 4 upgrade to PHP 5.

If you’re running on PHP 5 downgrade to PHP 4 (<- that is for a test and only if any other resort is available. You should consider that bad practice because it will bring you no-where in the near future)

These two advices might sound funny, but I know of both: WP PHP 5 sites that ran out of memory but then worked on PHP 4 and the other way round. Just give it a try.

These are best general tips I can give. The topic is broad, we normally handle that individually.

Leave a Reply

Your email address will not be published. Required fields are marked *