Count users, not enough memory error
Use .total() instead of .count()

.count() will query the db and fetch all fields for all items relating to your criteria and then count them. 

.total() only counts the number of items your criteria returns without all of their fields.