Right now, the workunit class will fail if it cannot allocate memory for all the workunits.
Limit the workunit generation to a certain number, and generate new workunits on the fly. This will allow much larger problem spaces to be attacked with a cluster.