I feel the need to point something out here. Both for me and Andrew, the program tops out at allocating ~22MB of memory - in total, over its whole run. Why, then, is max heap size over a gigabyte?