Apex heap size too large (when querying less than 1500 records) in a table

How many records are being returned in the Aggregate models?