Friday, April 28, 2017

Lỗi java lang outofmemoryerror java heap space eclipse và cách khắc phục trong Eclipse Java

Lỗi java lang outofmemoryerror java heap space eclipse và cách khắc phục trong Eclipse Java


How To Increase JVM Heap Size In Eclipse

L?i này ???c bi?t ??n là kích th??c b? nh? ?ã b? tràn v? v?y ta ph?i cài ??t l?i cho eclipse 
Eclipse throws java.lang.OutOfMemoryError: Java heap space

Following are the steps to increase JVM heap size in Eclipse: 
Step 1 - B??c 1
Open Eclipse and in the toolbar menu, go to Run -> Run Configurations…
Step 2- B??c 2
In the left pane of Run Configurations window, navigate to the Java Application node and select the Java application for which you need to increase the heap size. Then in the right pane, click on the Arguments tab.
In the VM Arguments section, type the following arguments:
-Xms[CUSTOM_SIZE] – This means that your JVM will be started with Xms amount of memory
-Xmx[CUSTOM_SIZE] – This means that your JVM will be able to use a maximum of Xmx amount of memory.
For example,
-Xms512M – JVM will start with an initial memory size of 512 MB
-Xmx1024M – and can use up to a maximum of 1024 MB (or 1 GB).
Click on Apply button to save the changes.
Note
The memory settings for Java programs running in Eclipse are different from the memory settings for eclipse itself. For increasing or decreasing the amount of memory used by Eclipse, changes should be made in the eclipse.ini file and NOT in the Run Configuration.


Available link for download