OutOfMemory while indexing project [message #1072756] |
Tue, 23 July 2013 12:40 |
Marcelo Taube Messages: 7 Registered: July 2013 |
Junior Member |
|
|
Hello,
I have been using CDT for developing C/C++ for a few years, i am quite used to the platform and think I know some quite advanced features.
Anyway I am working in a medium sized project, its only a few years old and probably less than 400 C files, each one probably around 5000 lines.
Till three months ago I worked with CDT without any problems but lately Eclipse crashes constantly on out of memory errors. I increased the heap size of the java three times from 500MB to 1.5GB but the problem still happens, i do not think the code base growed that much.
Lately i also tried filtering out many of the source directories which include code that i dont work with, I payed special attention to a few huge directories which include big self generated files and made sure they are not scanned by CDT.
That last move improved the speed of indexing significantly and also made the memory problems be less frequent but did not fix the whole mess up. If previouslly it would crash immediately while indexing now it fails in other places. While indexing I also seen many times that the OutOfMemory happened inside some function called UpdateManager.
I noticed for example eclipse crashing when changing configuration or renaming a variable.
To see if it helps, I also upgraded from Juno to the current version of Kepler, but the problem still happens.
Some more details of my system:
> workspace and project placed in my home directory over nfs
> Using git as a source control and using egit in eclipse to see history/annotations
> I recall that a few months ago i tried installed python plugin in eclipse and had to remove it because it made eclipse crash immediately
> My desktop has 4GB of memory, eclipse is the highest consumer of memory, typically i have the main memory not completely used and swap space is free
Here is the log CDT prints after indexing successfully:
Quote:!MESSAGE Indexed 'myproject' (352 sources, 762 headers) in 26.52 sec: 130,142 declarations; 581,823 references; 348 unresolved inclusions; 3,191 syntax errors; 19,791 unresolved names (2.70%)
Attached a stack trace of one of the last crashes and the contents of the configuration tab in the about window of eclipse.
Thanks for any help in finding the solution
Marcelo Taube
|
|
|
|
|
|
|
|
|
Re: OutOfMemory while indexing project [message #1075360 is a reply to message #1074129] |
Mon, 29 July 2013 09:46 |
Marcelo Taube Messages: 7 Registered: July 2013 |
Junior Member |
|
|
Found the main source of the problem which made CDT difficulties parsing.
There was a line like this:
#define MAX_OBJECTS MAX(1, MAX( 1, MAX( 1, MAX( 1, MAX( 4, MAX( 2, MAX( 1, MAX( 1, MAX( 33, MAX( 4, MAX( 1, MAX( 1, MAX( 2, MAX( 2, MAX( 2, MAX( 2, MAX( 2, MAX( 1, 1 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
int numbers[MAX_OBJECTS];
The preprocessor was generating a line of 4.7 million chars, and I guess CDT was having the same problem itself.
I fixed the code by changing all this to 33 directly.
But, it sounds there could be solutions to this kind of problem, there might be some heuristic CDT would like to implement to parse this.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04151 seconds