Exceed Memory error for $group operation on very small database

I have used a aggregate query with $group operation.
The database tested is of around 674MB. And, I have configured 11GB as wiredTigerCache.
Then, Why am I getting Exceed Memory error for $group operation on this database?
How can I avoid it?

Please share the aggregation pipeline that causes the issue.

There is no way we can tell if there is an issue with your code if we do not see your code.