Eclipse Java.lang.OutOfMemoryError:Java Heap space fault handling process

Source: Internet
Author: User

Recently, in the process of importing JEECG3.5.2 open source projects under the ECLIPSE-JEE-LUNA-SR2-WIN32 development environment (Java version:1.7.0_60), I found that internal Error was reported during the build workspace process. Viewing the. log file in the. Metadata folder under the workspace folder found the following error:

! ENTRY org.eclipse.core.jobs 4 2 2015-08-04 18:37:10.621
! MESSAGE An internal error occurred during: "Building Workspace".
! STACK 0
Java.lang.OutOfMemoryError:Java Heap Space
At Org.eclipse.wst.jsdt.internal.core.index.DiskIndex.readStreamChars (diskindex.java:884)
At Org.eclipse.wst.jsdt.internal.core.index.DiskIndex.readCategoryTable (diskindex.java:632)
At Org.eclipse.wst.jsdt.internal.core.index.DiskIndex.addQueryResults (diskindex.java:199)
At Org.eclipse.wst.jsdt.internal.core.index.Index.query (index.java:154)
At Org.eclipse.wst.jsdt.internal.core.search.matching.FieldPattern.queryIn (fieldpattern.java:330)
At Org.eclipse.wst.jsdt.internal.core.search.matching.InternalSearchPattern.findIndexMatches ( internalsearchpattern.java:92)
At Org.eclipse.wst.jsdt.internal.core.search.matching.OrPattern.findIndexMatches (orpattern.java:59)
At Org.eclipse.wst.jsdt.internal.core.search.matching.MatchLocator.findIndexMatches (matchlocator.java:407)
At Org.eclipse.wst.jsdt.internal.core.search.PatternSearchJob.search (patternsearchjob.java:116)
At Org.eclipse.wst.jsdt.internal.core.search.PatternSearchJob.execute (patternsearchjob.java:66)
At Org.eclipse.wst.jsdt.internal.core.search.processing.JobManager.performConcurrentJob (jobmanager.java:280)

......

There are a lot of solutions to this error on the Internet, and a few of them have no effect. The general idea is to resolve the parameters of the Java Virtual Machine in Eclipse preferences by modifying the memory allocation method of Eclipse. However, there are many different ways of saying what should be changed. 650) this.width=650; "title=" JVM parameter settings. png "style=" float:left; "src=" http://s3.51cto.com/wyfs02/M02/70/F0/ Wkiol1xbsw3tafbuaamlv53n9sg228.jpg "alt=" Wkiol1xbsw3tafbuaamlv53n9sg228.jpg "/>

To do this, carefully review the ECLIPSE-JEE-LUNA-SR2-WIN32 's readme_eclipse.html documentation (located in the Readme folder under the installation path). The answer to this question is given in the section "Allocating enough memory and solving outofmemoryerrors" in part 4th of the document "Running Eclipse":

by default, Eclipse would allocate up to megabytes of Java heap memory. This should is ample for all typical development tasks. However, depending on the JRE that is running, the number of additional plug-ins you is using, and the number of Fil  Es you'll be a working with, you could conceivably has to increase this amount. Eclipse allows-pass arguments directly to the Java VM using -vmargs the command line argument, which must fo Llow all other Eclipse specific arguments. Thus, to increase the available heap memory, you would typically use:

eclipse -vmargs -Xmx<memory size>

With the <memory size> value set to greater than "512M" (megabytes-the default).

When using a Oracle VM below 1.8, you could also need to increase the size of the permanent generation memory.  The default maximum is a megabytes, but more could be needed depending on your plug-in configuration and use. When the VM is runs out of permanent generation memory, it could crash or hang during class loading. This failure was less common when using Oracle JRE version 1.5.0_07 or greater. The maximum permanent generation size is increased using the-xx:maxpermsize=<memory size> argument:

eclipse -vmargs -XX:MaxPermSize=<memory size>

This argument is available for all VMS versions and platforms; Consult your VM documentation for more details.

Note that setting memory sizes to being larger than the amount of available physical memory on your machine would cause Java t O "Thrash" as it copies objects back and forth to virtual memory, which would severely degrade your performance.

Inspired by this, I did not go into the eclipse environment to set the JVM's memory by setting preferences, but instead created a shortcut to eclipse, in which the default D:\eclipse-jee-luna-SR2-win32\ Eclipse.exe modified to D:\eclipse-jee-luna-SR2-win32\eclipse.exe -vmargs-xmx1024m. the JVM parameters set during the previous attempt in the development environment are emptied.

Try again, success!

This article is from the "Wood" blog, make sure to keep this source http://highforest.blog.51cto.com/125539/1681844

Eclipse Java.lang.OutOfMemoryError:Java Heap space fault handling process

Related Article

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.