Increase heap size in Java to prevent java.lang.OutOfMemoryError
IncreaseheapsizeinJavatopreventjava.lang.OutOfMemoryErrorIfJavarunsoutofmemory,thefollowingerroroccurs:Exceptioninthread"main"java.lang.OutOfMemoryError:JavaheapspaceThiscanhavetworeasons:YourJavaappl