Java Heap Space

Any idea why this error is occurring?
If I remove the biggest and main level from the Cook directory in project settings I don’t get this error and project builds perfectly.