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

This reverts commit 1221151d37f83f887bd790c2699267638df313bb.