• Hey!

    My webhosting package has 128MB of RAM (memory_limit) but every time I publish or update an article, it says “memory limit exhausted”. I do know what this message means, but that is not the question.

    My website is about 6 years old, but there are only very few plugins, so I don´t know why it is using that much RAM. Even more funny: I have installed a “clean” version of wordpress and imported all posts, using the same theme and installed the same plugins: it runs without problems and without any memory errors.

    So why is there a memory error on the 5 year old site (updated regularly) and why is the clean install running perfectly? What would you recommend to solve the problem? I don´t want to buy a better server with a higher memory limit, I want to solve the issue 🙂

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,
    Try this:
    Edit you index.php wordpress file and this at first line:
    ini_set(‘memory_limit’, ‘-1’);

    Regards

    jack randall

    (@theotherlebowski)

    also, if you’re on a shared server then you’re not the only one using all the RAM. check with your host to see what’s going on, it may be that there’s another site that’s hogging the system resources leaving you with the scraps…

    I use this in my theme’s functions.php file:

    function memory_stats()
    { // BEGIN function memory_stats
          echo '<p style="clear: both;">Memory used: '. number_format(memory_get_usage(true)). ' bytes.<br />';
          echo 'Peak Memory used: '. number_format(memory_get_peak_usage(true)).' bytes.</p>';
    
    } // END function memory_stats
    
    add_action('in_admin_footer', 'memory_stats');

    This will tell you how much memory you are using at the bottom of your Dashboard. You can also call memory_stats() in your theme’s footer.php to see how much the front-end is using.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Memory Questions’ is closed to new replies.