Code optimization to avoid 'out of memory' exceptions. Increasing the java heap space to 16g.