[wp-hackers] get_users() exhausts memory with 'all_with_meta' argument

Mike Walsh mpwalsh8 at gmail.com
Fri Jan 3 15:10:27 UTC 2014


I am working with a couple users who use the Email Users plugin where
memory is being exhausted when calling get_users() with the 'fields'
argument set to 'all_with_meta'.  In both cases, the sites have a large
number of users (one has 13k, the other 4.5k).  In both cases a call to
get_users() without any arguments succeeds but fails when the
'all_with_meta' option is used.

Anyone run into this before?  If so, how did you resolve it?

So this works:

$u = get_users();

But this fails:

$u = get_users(array(fields => 'all_with_meta'));

I've asked one user to do add the following to their wp-config.php to see
if it makes a difference:

define('WP_MEMORY_LIMIT', '512M');

It may work for this site however I am not sure if it simply delays a
future failure or actually fixes it (if it does at all).

Mike
-- 
Mike Walsh - mpwalsh8 at gmail.com


More information about the wp-hackers mailing list