Count users, not enough memory error Hi I have like 2000 users in my system. I would like to get a count of the active ones, so I did it like this:

{{craft.users.group('member').count()}}


but this returns the count with the limit of 100, so when I remove the limit

{{craft.users.group('member').limit(null).count()}}


I got this error

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /Users/alex/git/website/craft/app/models/BaseModel.php on line 280
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.