This is probably due to the JVM settings with which Eclipse launches the application. When you run the Jar, Java will best guess which settings to use in memory. You can change the size of memory used with the java command on the console:
java -Xms64m -Xmx256m -cp your.jar
-Xms??m sets the minimum heap size in mb.
-Xmx??m sets the maximum heap size in mb.
Java probably automatically automatically selects the size of the large heap, as it is not dictated by eclipse.
source share