Setting of insufficient memory for myecllipse

Source: Internet
Author: User
The setting of insufficient memory for myecllipse-Linux general technology-Linux programming and kernel information. The following is a detailed description. If no configuration is made after installation, a message about insufficient memory may frequently appear during MyEclipse running.

For example, MyEclipse has detected that less than 5% of the 64 MB of Perm Gen (Non-heap memory) space remains.

The prompt also provides a solution to the problem. Add the following sentence to the eclipse configuration file:

-Vmargs-Xms128M-Xmx512M-XX: PermSize = 64 M-XX: MaxPermSize = 128 M

However, it is worth noting that you cannot directly paste this sentence into the eclipse. ini file, but it should be shown in the following format.

-Vmargs
-Xms128M
-Xmx512M
-XX: PermSize = 64 M
-XX: MaxPermSize = 128 M

The following are some background information about these settings:

Heap and Non-heap memory
According to the official statement: "A Java virtual machine has a heap. The heap is the runtime data area, and the memory of all class instances and arrays is allocated from this place. The heap is created when the Java Virtual Machine is started ." "Memory outside of the heap in JVM is called Non-heap memory )". JVM manages two types of memory: heap and non-heap. In short, heap is the memory available for Java code and is reserved for developers. Non-heap is reserved for JVM, therefore, the method area, JVM internal processing or optimization of the required memory (such as the code cache after JIT compilation), each class structure (such as the runtime data pool, field and method data) the methods and constructor code are all in non-heap memory.

Heap Memory Allocation
The initial memory allocated by JVM is specified by-Xms. The default value is 1/64 of the physical memory. The maximum memory allocated by JVM is specified by-Xmx. The default value is 1/4 of the physical memory. By default, when the free heap memory is less than 40%, the JVM will increase the heap until the maximum limit of-Xmx. When the free heap memory is greater than 70%, the JVM will reduce the minimum limit of heap until-Xms. Therefore, the server generally sets-Xms and-Xmx to be equal to each other to avoid adjusting the heap size after each GC.

Non-heap memory allocation
JVM uses-XX: PermSize to set the non-heap memory initial value. The default value is 1/64 of the physical memory. The maximum non-heap memory size is set by XX: MaxPermSize. The default value is 1/4 of the physical memory.

JVM memory limit (maximum)
First, JVM memory is limited by the actual maximum physical memory. If the physical memory is infinitely large, the maximum JVM memory has a great relationship with the operating system. Simply put, although the 32-bit processor has a controllable memory space of 4 GB, the specific operating system will impose a limit, this limit is generally 2 GB-3 GB (1.5 GB-2 GB in Windows and 2 GB-3 GB in Linux ), the 64-bit and above processors will not be limited.

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.