Add RAM heuristics for larger heap sizes.

This patch leaves large amounts of free RAM for very large heaps.
This allows intermediate data to fit in buffer cache, even
for bigger shuffles.