Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT parser OutOfMemoryError(Eclipse 2019-09 single file parsing)
CDT parser OutOfMemoryError [message #1817794] Fri, 29 November 2019 09:35 Go to next message
Federer Roger  is currently offline Federer Roger Friend
Messages: 30
Registered: December 2017
Member
FileContent fileContent = FileContent.createForExternalFileLocation(fileLocation);
            IScannerInfo scannerInfo = new ScannerInfo();
            IncludeFileContentProvider readerFactory = IncludeFileContentProvider.getEmptyFilesProvider();
            IASTTranslationUnit tu = GPPLanguage.getDefault().getASTTranslationUnit(fileContent, scannerInfo,
                readerFactory, null, ILanguage.OPTION_PARSE_INACTIVE_CODE, new DefaultLogService());
            System.out.println(tu.getRawSignature());


There is a java.lang.OutOfMemoryError when I use the code to parse a single file. Is it a bug or not?
  • Attachment: main.cpp
    (Size: 12.31KB, Downloaded 41 times)
  • Attachment: parser_error.png
    (Size: 104.37KB, Downloaded 117 times)
Re: CDT parser OutOfMemoryError [message #1817814 is a reply to message #1817794] Fri, 29 November 2019 14:24 Go to previous messageGo to next message
David VavraFriend
Messages: 1430
Registered: October 2012
Senior Member
Don't know if it's a bug or not.
The file is rather complicated.
Try inserting the code in pieces until you encounter the problem.

I tried doing so and got to line 195 but it failed after that.
After the problem occurred, I had to delete the .cproject, .project files and .settings dir.
It was a nuisance recreating them.

Start a new project without the main.cpp file.
save the project files.
Add pieces from main.cpp until the error occurs.
There may be something obvious that you can fix.

You can also increase JVM heap and see if that helps.
https://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F
Re: CDT parser OutOfMemoryError [message #1817867 is a reply to message #1817814] Mon, 02 December 2019 03:52 Go to previous message
Federer Roger  is currently offline Federer Roger Friend
Messages: 30
Registered: December 2017
Member
Thanks for your reply. I have already report it to CDT team. You can check BugId 553613 to see.
Previous Topic:Can't export project to eclipse IDE
Next Topic:How to load a file content into a new editor tab
Goto Forum:
  


Current Time: Sat Aug 13 16:42:19 GMT 2022

Powered by FUDForum. Page generated in 0.01917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top