get_posts memory usage
-
I am trying to run a get_posts in order to get all the posts, as I want to process every one of them.
However I’m having a problem with memory – according to memory_get_usage(), this one call increases the memory usage of wordpress by 11MB (retrieving 364 posts). This isn’t too bad, as I could just do it a few posts at a time, but the memory doesn’t free up afterwards…
I am unset()ing the return value array but this makes little difference, reducing it by only about 1.5MB. So whether I do one post at a time or all 364 of them in one get_posts query I still run out of memory. I’ve tried calling wp_reset_query() and it makes no difference at all.
Is there a way around this?
The topic ‘get_posts memory usage’ is closed to new replies.