A java.lang.OutOfMemoryError: Java heap space error means the Java Virtual Machine (JVM) ran out of memory to allocate new objects. This happens because your heap size is too small, or your program is suffering from a memory leak where unused objects are continually held in memory