Should I Increase Memory in My Plugin? (3 posts)

  1. Allen
    Posted 4 years ago #

    I wrote a plugin that's been out for about 1 year and now doing some testing on an upgrade on my local machine. Out of the blue, I just started getting this error (not as a result of any coding change or adding plugins)

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 80 bytes) in /Users/me/Dropbox/My Webs/wordpress/wp-includes/class-simplepie.php on line 14866

    Asking users to increase their memory doesn't make sense since plugin users aren't always that tech savvy.

    So, I'm wondering if I can do this for them by adding something like

    (‘WP_MEMORY_LIMIT’, ’128M’)

    But is this ok to do..meaning changing their wordpress memory limit just for my plugin? Is there something else you'd suggest?


  2. Ayman
    Posted 4 years ago #


    (‘WP_MEMORY_LIMIT’, ’128M’)

    will limit the whole website... So why don't you try this:
    Put this line of code in the main file of your plugin so when the plugin runs will load the limits directly.
    ini_set('memory_limit', '128M');

  3. Allen
    Posted 4 years ago #

    Thanks Ayman...will need to think about this since I've seen on some other sites that increasing the memory is bad form for wordpress plugin developers...might need to do this on a case by case basis when a user has a problem.

Topic Closed

This topic has been closed to new replies.

About this Topic