Wouldn't that (maxheap = .9 * memsize - 50 meg) be way too small on a low memory machine? E.g., my laptop has 128 meg and your calculation would reduce MLton down to about 67 meg. I don't think I ever had any swapping problem on it as is (although it is still running a 2.2 kernel).