Community
Participate
Working Groups
Build Identifier: Helios SR1 See https://bugs.eclipse.org/bugs/show_bug.cgi?id=149121 for background information. I have a workspace that exhibits bug described in above bugzilla, I have tried the workaround described in comment #50. This in turn causes the issue where the parser seems to get into a loop and uses up entire java heap, which then triggers a message asking user to exit the workbench. Thus if 149121 is fixed with workaround described in comment #50, then CDT could trigger this issue. I am not sure if this is project specific or not. Workspace .log file contains this call stack. I have also attached the workspace that exhibits this issue. !ENTRY org.eclipse.core.jobs 4 2 2011-04-07 14:35:17.078 !MESSAGE An internal error occurred during: "Computing Macro Expansion". !STACK 0 java.lang.OutOfMemoryError: Java heap space at java.util.ArrayList.ensureCapacity(Unknown Source) at java.util.ArrayList.add(Unknown Source) at org.eclipse.cdt.internal.core.pdom.dom.PDOMFile.getMacros(PDOMFile.java:580) at org.eclipse.cdt.internal.core.index.IndexBasedFileContentProvider.collectFileContent(IndexBasedFileContentProvider.java:174) at org.eclipse.cdt.internal.core.index.IndexBasedFileContentProvider.getContentForInclusion(IndexBasedFileContentProvider.java:125) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor$1.checkFile(CPreprocessor.java:103) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor$1.checkFile(CPreprocessor.java:1) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.findInclusion(CPreprocessor.java:935) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.executeInclude(CPreprocessor.java:1251) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.executeDirective(CPreprocessor.java:1067) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.internalFetchToken(CPreprocessor.java:726) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.fetchToken(CPreprocessor.java:469) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.nextToken(CPreprocessor.java:563) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.fetchToken(AbstractGNUSourceCodeParser.java:260) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.nextToken(AbstractGNUSourceCodeParser.java:284) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.acceptInactiveCodeBoundary(AbstractGNUSourceCodeParser.java:345) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.declarationList(AbstractGNUSourceCodeParser.java:1283) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.parseTranslationUnit(AbstractGNUSourceCodeParser.java:1253) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.translationUnit(AbstractGNUSourceCodeParser.java:1248) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.parse(AbstractGNUSourceCodeParser.java:645) at org.eclipse.cdt.core.dom.parser.AbstractCLikeLanguage.getASTTranslationUnit(AbstractCLikeLanguage.java:143) at org.eclipse.cdt.internal.core.model.TranslationUnit.getAST(TranslationUnit.java:806) at org.eclipse.cdt.internal.core.model.TranslationUnit.getAST(TranslationUnit.java:770) at org.eclipse.cdt.internal.core.model.ASTCache$1.run(ASTCache.java:295) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.cdt.internal.core.model.ASTCache.createAST(ASTCache.java:289) at org.eclipse.cdt.internal.core.model.ASTCache.getAST(ASTCache.java:168) at org.eclipse.cdt.internal.core.model.ASTCache.runOnAST(ASTCache.java:215) at org.eclipse.cdt.internal.ui.editor.ASTProvider.runOnAST(ASTProvider.java:344) at org.eclipse.cdt.internal.ui.text.c.hover.CMacroExpansionInput$1.run(CMacroExpansionInput.java:276) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) !ENTRY org.eclipse.cdt.ui 4 4 2011-04-07 14:35:26.069 !MESSAGE Error !STACK 0 java.lang.OutOfMemoryError: Java heap space at java.util.ArrayList.ensureCapacity(Unknown Source) at java.util.ArrayList.add(Unknown Source) at org.eclipse.cdt.internal.core.pdom.dom.PDOMFile.getMacros(PDOMFile.java:580) at org.eclipse.cdt.internal.core.index.IndexBasedFileContentProvider.collectFileContent(IndexBasedFileContentProvider.java:174) at org.eclipse.cdt.internal.core.index.IndexBasedFileContentProvider.getContentForInclusion(IndexBasedFileContentProvider.java:125) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor$1.checkFile(CPreprocessor.java:103) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor$1.checkFile(CPreprocessor.java:1) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.findInclusion(CPreprocessor.java:935) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.executeInclude(CPreprocessor.java:1251) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.executeDirective(CPreprocessor.java:1067) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.internalFetchToken(CPreprocessor.java:726) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.fetchToken(CPreprocessor.java:469) at org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.nextToken(CPreprocessor.java:563) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.fetchToken(AbstractGNUSourceCodeParser.java:260) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.nextToken(AbstractGNUSourceCodeParser.java:284) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.acceptInactiveCodeBoundary(AbstractGNUSourceCodeParser.java:345) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.declarationList(AbstractGNUSourceCodeParser.java:1283) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.parseTranslationUnit(AbstractGNUSourceCodeParser.java:1253) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.translationUnit(AbstractGNUSourceCodeParser.java:1248) at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.parse(AbstractGNUSourceCodeParser.java:645) at org.eclipse.cdt.core.dom.parser.AbstractCLikeLanguage.getASTTranslationUnit(AbstractCLikeLanguage.java:143) at org.eclipse.cdt.internal.core.model.TranslationUnit.getAST(TranslationUnit.java:806) at org.eclipse.cdt.internal.core.model.TranslationUnit.getAST(TranslationUnit.java:770) at org.eclipse.cdt.internal.core.model.ASTCache$1.run(ASTCache.java:295) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.cdt.internal.core.model.ASTCache.createAST(ASTCache.java:289) at org.eclipse.cdt.internal.core.model.ASTCache.getAST(ASTCache.java:168) at org.eclipse.cdt.internal.core.model.ASTCache.runOnAST(ASTCache.java:215) at org.eclipse.cdt.internal.ui.editor.ASTProvider.runOnAST(ASTProvider.java:344) at org.eclipse.cdt.internal.ui.text.c.hover.CSourceHover$1.run(CSourceHover.java:734) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Reproducible: Always Steps to Reproduce: 1. unzip workspace 2. Use eclipse to open this workspace (it should fail) 3. Apply workaround described at the end of comment #50 from 149121 4. Start eclipse again. This workspace is based on an custom product that uses unmodified EPP CDT Helios SR1 package as baseline, but also includes a number of other plugins.
Actually I can't attach a large .zip, I can send it separately.
What is the maximum heap size you are using when running into this issue?
I was using the default setting of 384. I enabled the display of java heap display and if I am quick enough when I hit recycle bin to garbage collect, then heap goes down a lot and then sits there for 2-3 seconds, then whatever process kicks of parsing starts again and java heap gets used up very quickly. The project is not large maybe 15-20 source files and it takes about 15-20 seconds for the heap to get used up once the process starts.
Can you try to delete <workspace>/.metadata/.plugins/org.eclipse.cdt.core ?
That worked around this issue. Heap is steady and no messages asking to exit.
I assume that the files had been parsed using a wrong character encoding. This would lead to a lot of useless information in the index. When loading this information, the OutOfMemoryError can occur.
I would be very surprised if encoding was changed from defaults. I checked with the customer and their response was "what encoding". Would workspace .metadata help? or project itself? I think I should be able to attach both if I separate them out.