Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: compuluke on October 21, 2005, 11:57:24 pm

Title: memory usage
Post by: compuluke on October 21, 2005, 11:57:24 pm
Hello.  New to code::blocks.  Kickass so far though.

However, one (big) problem.  When I "add files recursively" to a new project, my 2 gigs of physical memory fills up and renders my machine inoperable.  I even "niced" it.

Anyone else have this?  I've cleaned the project before hand, so it's just parsing text and not binaries.

L
Title: Re: memory usage
Post by: rickg22 on October 22, 2005, 12:14:13 am
Yikes! :shock: Sounds like a big memory leak in there! I haven't tried that feature yet.

Yiannis, any ideas?
Title: Re: memory usage
Post by: thomas on October 22, 2005, 01:36:33 am
Just tried to reproduce that using RC1-1, added 876 files recursively:

(http://img465.imageshack.us/img465/4429/addrecurs5vw.png)

Well, it takes stunning amounts of CPU (clearly there is room for improvement in that matter), but I was not able to reproduce the memory issue. Memory was never more than 22.5 MB in this experiment.

EDIT:
If you wonder why CPU and memory do not correlate tightly, this is my fault. I took two screenshots for the two graphs (while time passed on). The lower graph thus needs to be shifted a bit to the right ;)
Title: Re: memory usage
Post by: Ceniza on October 22, 2005, 03:07:14 am
Quote from: Private Bytes History
no idea what *that* is

It could be the CodeCompletion plugin.
Title: Re: memory usage
Post by: thomas on October 22, 2005, 01:35:41 pm
Right, that explains why it is 100% user time from that point, too.
Title: Re: memory usage
Post by: compuluke on October 24, 2005, 05:05:37 pm
I'll try the same memory/cpu test.  Which graphical system monitor is that?
Title: Re: memory usage
Post by: takeshimiya on October 24, 2005, 06:33:48 pm
Probably it is Process Explorer (http://www.sysinternals.com/Utilities/ProcessExplorer.html) from Sysinternals.

For sure, it provides less info than profiling, but lot of more info than Windows Task Manager :P
It's an utility that goes in the must-have programmer tools I think.
Title: Re: memory usage
Post by: thomas on October 24, 2005, 08:54:50 pm
Yep, this is Process Explorer. You will of obviously have to use a different tool on Linux, since Process Explorer is Windows only (gtop will probably do just fine).

There is no heavy GUI stuff going on during the loading of a project, merely a list of filenames (wxArrayString) is looked at one by one and added to a linked list (or several lists). Since this is the very same code on Linux and Windows, I dared to make that comparison. If wxArrayString and wxList leak memory on Linux (or the subroutine that calls them does), they leak on Windows, too.
Obviously, you could not assume the same if we were talking about some heavy widget drawing stuff ;)