Revert "Revert "Remove Shopify's hacky heap limiting in favour of spark's.""

This reverts commit e91e0d42a70a59410e2b5540f1398d8c608d9581.