News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

C::B using huge amounts of memory

Started by Kazade, August 13, 2010, 01:15:45 PM

Previous topic - Next topic

Kazade

I'm having some real problems with CodeBlocks on a reasonably large project (~20,000 lines). I'm using the latest build from Pasgui's Ubuntu repository on Ubuntu 10.10. The problem I'm having is that everything will work fine for an hour or so, and then the hard disc starts churning and the PC becomes pretty unresponsive (although not totally). When I run "top" it shows that C::B is using 70-80% of my memory (around 2.7G) and the CPU is using around ~60.0% I think the general slow down is due to the disk swapping when I run out of memory.

This seems to be related to the code completion plugin. I've just disabled it and restarted C::B and now memory usage is a far more respectable 465M and CPU ~3%.

Has anyone else experienced a problem like this?

oBFusCATed

Looks like you've written some code that breaks the parser in the code completion plugin.
Can you try to produce a minimal project that reproduces the problems?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Kazade

Um, I would... but I'm not even sure where to begin, how can I tell where the problem is?

ollydbg

codecompletion plugin use a TokensTree structure to store all the Tokens( the same term is the Tag). so if your project is large, the TokensTree may explode.

But I suspect the problem is located in some macro expansion. You can try to disable the "macro expansion" option in the CC's option dialog and see it happens again.  :D

BTW: try use a more recent codeblocks, like nightly build version.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.