Either increase the amount of memory allocated to the heap via the JVM (see this), or ensure you read the minimal amount of data on each iteration and release all resources before proceeding with the...