When Java program executes, the JVM uses Heap memory to
manage the runtime data. If your program
required more than what memory is allotted then we get OutOfMemoryError.
The heap size may be configured with the following VM options:
·
-Xmx<size> -
to set the maximum Java heap size
·
-Xms<size> -
to set the initial Java heap size
For example, you can set minimum heap to 126 MB and maximum
heap 512 MB for a Java program.
Eclipse:
In Eclipse, The eclipse.ini
is a text file containing command-line options
that are added to the command line used when Eclipse is started up.
Open the eclipse.ini (any
Editor, here I am using Notepad++)
-Xms256m
-Xmx1024m
Save the file. This is
the way you can increase heap memory size.
No comments:
Post a Comment