How to increase the heap size of the Java Virtual Machine to handle large result data?

Just increase the heap size a little by setting this option in  Run → Run Configurations → Arguments → VM arguments

-Xms6g -Xmx12g

Xms – for minimum limit

Xmx – for the maximum limit

Note: choose the minimum and maximum limit according to your need.