Cause MyEclipse out of memory reason analysis and solution

  • 2020-04-01 04:34:03
  • OfStack

1. Modify eclipse.ini

In the Myeclipse installation directory G:\MyEclipse8.5\Genuitec\ Myeclipse 8.5 there is a myeclipse.ini configuration file set as follows:

- vmargs
- Xmx512m
- XX: MaxPermSize = 256 m
- XX: ReservedCodeCacheSize = 64 m

2. Set Default VM Arguments

In myEclipse, open Windows-> The Preferences - > Java - > Installed JREs - > Click on the JDK-> in use; Edit - > Default VM Arguments textbox: -xms64m     - Xmx256m

3. If the memory overflow is reported in the web project, tomcat memory may be set.

(1) tomcat installation root directory %tomcat%bin/catalina.bat file, SET JAVA_OPTS line;
Set JAVA_OPTS= -xms1024m-xmx1024m-xx :PermSize= 128m-xx :MaxPermSize=256m
The values inside can be adjusted according to the specific situation of the project and the specific situation of the machine

(2) myeclipse configuration web server configuration Window -- Preferences -- myeclipse -- Servers -- tomcat 5. X -- JDK Optional Java VM arguments:

- Xms256m - Xmx512m - XX: MaxNewSize = 256 m - XX: MaxPermSize = 256 m

4. If it is running in debug mode, the virtual machine parameters of debug need to be adjusted, because the default memory allocation of debug mode is very small.

5. If eclipse runs junit, the test encounters memory problems

When all the test cases were Run, it was found that they could not Run out. OutOfMemoryError appeared when some of the later test cases were Run. It was caused by junit.

The value set when Eclipse started JUnit was about 64M, and my monitoring of memory usage when I increased the memory showed that all the test cases required 100M of memory.

The method is: Run-> The Run... - > JUnit - > AllTests - > (x) = Arguments - > The VM Arguments: - Xmx500m

Notice that AllTests above is the class you want to modify for the Test suite that contains all the Test cases.

-xmn is a younger generation and is generally not more than half the heap size (-xms and -xmx)

The above content introduced to you the cause of MyEclipse insufficient memory analysis and the solution of the relevant knowledge, I hope you like.


Related articles: