If you are facing following exception while running your code:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Default size of most of JVM Java Heap Space is around 64MB, it can easily ran out of memory if your application add more content in it.
Hence in order to fix this you can specify size of Java Heap using JVM options "-Xms:MinHeapSize" and "-Xmx:MaxHeapSize" based on your project need.
For example,
-Xms512M -Xmx1024M
The settings start the Java virtual machine with a minimum heap memory of 512M, a max heap size of 1024M i.e. 1GB.
You can set this in Computer Environment Variable as shown in below image:
0 Comment(s)