[Go] How to solve myeclipse memory overflow?

Source: Internet
Author: User

In the use of MYECLIPES10 development encountered a memory overflow problem, Baidu for a long time, this article is more perfect.

Sum up three aspects to check

1) myeclipes configuration: Myeclipes 10 under the installation path of Myeclipse.ini

2) Configure the JDK's operating parameters, similar to the MAVEN parameters

3) Configure the Tomcat parameters

Original link:

How to solve myeclipse memory overflow?
  1. Open the Myeclipse.ini file in the MyEclipse 10 installation directory

  2. Open the file and set the contents of the file circle as:

  3. Above is one of the solutions, the second solution is described below

    Set the default VM Arguments, open myeclipse->windows->preferences->java-installed JREs

    , click the Jdk->edit->default VM Arguments input you are using-xms64m-xmx256m

    or-xms800m-xmx800m-xx:maxnewsize=256m-xx:maxpermsize=256m.

  4. If it is a Web project or a memory overflow, you also need to set up Tomcat memory.

    MyEclipse Configuring the Web server myeclipse->windows->preferences->servers->tomcat6.x->

    The JDK's optional Java VM arguments is configured as:

    -server-xms1024m-xmx1024m-xx:permsize=128m-xx:maxnewsize=512m-xx:maxpermsize=256m-djava.awt.headless=true

The end says a bit: The rationale for the configuration analysis

Toward MyEclipse Window/preferences/myeclipse....../servers/tomcat/tomcat 6.X/JDK

Optional Java VM arguments:

Input:-xms256m-xmx512m-xx:maxnewsize=128m-xx:maxpermsize=256m

Explain:

(1)-xms400m: initial physical Memory value (heap memory)

(2)-xmx400m: Maximum physical memory value (heap memory)

(3)-xx:maxnewsize=1024m: Maximum New zone value (non-heap memory)

(4)-xx:maxpermsize=1024m: value of maximum permanent domain (not heap memory)

Knowledge points need to be mastered:

1, Java has two kinds of memory: one is stack memory, the other is heap memory.

2, its default space (that is,-XMS) is the physical memory of 1/64, the maximum space (-XMX) is the physical memory of 1/4. If the memory is less than 40%,JVM the value of the heap to the XMX setting is increased, the memory remaining more than 70%,JVM will reduce the heap to XMS setting value. So the server's xmx and XMS settings should generally be set identically to avoid resizing the virtual machine heap after each GC. Assuming that the physical memory is infinite, then the maximum size of the JVM memory is related to the operating system, the general 32-bit machine is between 1.5g and 3g, and 64-bit will not be limited.

Note: If XMS exceeds the XMX value, or if the sum of the heap maximum and the non-heap maximum exceeds the physical memory or the maximum operating system limit, the server will not start up.

3, another is the Java memory heap is insufficient, will continue to call the GC, if the continuous recovery can not solve the problem of insufficient memory heap, will be reported out of a memory error.

4, the basic type variables defined in the function and the reference variables of the objects are allocated in the function's stack memory.

5. Heap memory is used to store objects and arrays created by new.

6, the advantage of the heap is the ability to dynamically allocate memory size, the lifetime does not have to tell the compiler beforehand, because it is the dynamic allocation of memory at run time. The disadvantage is that the memory is dynamically allocated at runtime and the access speed is slow.

7, the advantage of the stack is faster access than the heap, the disadvantage is that the existence of data size in the stack and the survival period must be determined without flexibility.

8, the Heap Size should not exceed 80% of the available physical memory, general to set the-XMS and-XMX options to the same, and-xmn to 1/4-xmx value.

9. The Java heap is divided into three zones: New, old, and permanent.

[Go] How do I resolve a myeclipse memory overflow?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.