Eclipse has set the JVM size in the startup parameters, because the Eclipse runtime itself needs the JVM, so the JVM size set in Eclipse.ini is not the size of the JVM used by a particular program to run, regardless of the size of the JVM in which the program runs.
So how to set the JVM size of a program (of course, the console does not run the problem, such as: java-xms256m-xmx1024m classname, so that the current program's JVM size can be set).
Because the JVM of the default program in Eclipse is configured to:-xms8m-xmx128m, we need to manually adjust our processing memory when it is larger so that there is no memory overflow. The specific setting method is:
Select the class that is being run, click on the menu ' Run->run ... ', select (x) =argument The VM Arguments box under the page to enter-xmx512m, save the Run is OK
Screenshot 1:
Screenshot 2: