Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting 'An internal error occurred during: "Compacting resource model".' when building a project in eclipse indigo

I am getting the following error when building a project in eclipse indigo:

 An internal error occurred during: "Compacting resource model". Java heap.
  1. Is this a memory problem?

  2. Is it possible to compile a single package in eclipse (like similar to netbeans)? I had got a similar memory problem in netbeans but I got around it by compiling smaller number of packages at a time.

I had compiled the same project in ganemede without any problem.

UPDATE:

Stacktrace:

 !ENTRY org.eclipse.core.jobs 4 2 2012-03-07 09:39:49.520
 !MESSAGE An internal error occurred during: "Compacting resource model".
 !STACK 0
 java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.newKeyIterator(Unknown Source)
at java.util.HashMap$KeySet.iterator(Unknown Source)
at java.util.HashSet.iterator(Unknown Source)
at org.eclipse.core.internal.jobs.JobManager.findBlockingJob(JobManager.java:685)
at org.eclipse.core.internal.jobs.JobManager.doRunNow(JobManager.java:1085)
at org.eclipse.core.internal.jobs.JobManager.runNow(JobManager.java:1080)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:89)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:286)
at org.eclipse.core.internal.utils.StringPoolJob.run(StringPoolJob.java:101)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

 !ENTRY org.eclipse.core.jobs 4 2 2012-03-07 09:39:49.521
 !MESSAGE An internal error occurred during: "Build Project".
 !STACK 0
java.lang.OutOfMemoryError: Java heap space
at org.eclipse.wst.jsdt.core.compiler.CharOperation.concat(CharOperation.java:689)
at org.eclipse.wst.jsdt.core.infer.InferEngine.createAnonymousTypeName(InferEngine.java:682)
at org.eclipse.wst.jsdt.core.infer.InferEngine.createAnonymousType(InferEngine.java:658)
at org.eclipse.wst.jsdt.core.infer.InferEngine.visit(InferEngine.java:2072)
at org.eclipse.wst.jsdt.internal.compiler.DelegateASTVisitor.visit(DelegateASTVisitor.java:855)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.traverse(ObjectLiteral.java:66)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:459)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:174)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.traverse(FunctionExpression.java:48)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField.traverse(ObjectLiteralField.java:63)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.traverse(ObjectLiteral.java:69)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField.traverse(ObjectLiteralField.java:63)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.traverse(ObjectLiteral.java:69)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:459)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:174)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.traverse(FunctionExpression.java:48)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:455)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:584)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:539)
at org.eclipse.wst.jsdt.core.infer.InferEngine.doInfer(InferEngine.java:1747)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.inferTypes(Parser.java:7093)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:561)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.beginToCompile(Compiler.java:328)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:342)
at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:288)
at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:86)
at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:254)
at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:58)
at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:291)
at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:194)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
like image 645
Harke Avatar asked Nov 13 '22 09:11

Harke


2 Answers

Open eclipse configuration(eclipse.ini) file folder from eclipse directory

-vmargs
-Xms128m
-Xmx512m
-XX:MaxPermSize=128m

place this code ...its work for me

like image 135
Tush Avatar answered Nov 16 '22 04:11

Tush


You need more heap (RAM).

-Xmx in the eclipse.ini file (for me on Linux Ubuntu it is here: "/home/my_username/eclipse/cpp-2019-12/eclipse/eclipse.ini") specifies the maximum heap space (RAM) you are authorizing Eclipse to use. Give it more. If -Xmx512m (512 MB) of RAM isn't enough, try more: -Xmx1024m, or -Xmx2048m, etc, until it is enough and you quit getting crashes.

I talk about this in my Eclipse document here:

  1. readme with links to it in PDF or Google Drive form: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/tree/master/eclipse

Eclipse is powerful, but it is a terrible terrible terrible memory hog. On some machines for some repos I set it to -Xmx32768 (32 GB--yeah--nuts--but try letting Eclipse index a massive repo with the Boost library included and this still isn't enough).

like image 35
Gabriel Staples Avatar answered Nov 16 '22 03:11

Gabriel Staples