On Memory consumption of KDevelop-PG

Alexander Dymo alexander.dymo at gmail.com
Sat Dec 19 16:36:59 UTC 2009

субота, 19-гру-2009 11:49:47 Andreas Pakulat ви написали:
> IMHO its no big deal if the parser needs some 200M for parsing a single
> file as long as afterwards the memory is free again for re-use. In
> particular it must not be fragmented (which should already work due to
> usage of the memory pool). For how to make the AST smaller see further
> down on your "compress the AST" question.

Well, but now huge parser memory consumption is an issue (at least for C++). I 
have 3.5M C file which is parsed into 550M AST. 
550M isn't that small amount of memory...

And that's just one file. Try parsing Ruby language sources - you'll end up 
using 3G of memory for parsing. That's definitely wrong. Not everybody has 
this much of memory.

There're actually bugs in c++ parser where it creates AST nodes which aren't 
used (added to the tree). I have a patch (not public yet, still breaks some 
duchain tests) for that which reduces the memory consumption in my test case 
from 550M to 400M. But that's all I can do without doing AST compression or 
removing members from AST classes.

More information about the KDevelop-devel mailing list