News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

TODO list HUGE memory leak

Started by rickg22, June 20, 2007, 02:45:08 AM

Previous topic - Next topic

rickg22

Bad news guys! I just tested the todo list (i have no code completion enabled - in fact i deleted them from my cb dir) and everytime i click on a line, the memory usage for C::B doubles. I got it to consume up to 220MB in just two clicks!

Any idea what's happening with it?

SVN Rev 4110.

Update: Filed as bug #11421

dmoore

hmm... A few days back I noticed that when I disabled it that file load times increased significantly (Astyle and the, more understandably, the codecompletion plugin also slowed file loads)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rickg22

#2
I found out.

EVERY SINGLE TIME a file is opened, closed or even ACTIVATED, the parsing is re-done. And this is disregarding the current settings (per file, per project, open files). Since the log doesn't have a memory of todo items, it has to reparse before every refresh. Also, it does the scanning while opening the project, and not AFTER.

OK guys i'm tackling this one. I'll use a std map<wxString,vector<whatever >> to keep a "database" of todo items per file.

Revamp.. ON!!!  8)

dmoore

PS: compare the file load times between SciTE and codeblocks. Even with multi megabyte files SciTE opens virtually instantly. Only when you disable those three plugins I mentioned do you get close to the same speed in cb (the remaining sluggishness probably has something to do with line endings settings).

keep us posted
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Biplab

#4
Rick,

I'm also working on similar problem since past week. :) I've added couple of SDK functions to detect Project/Workspace Loading/Closing state.

The idea is to stop this unnecessary parsing during project/workspace load/close or during app shutdown. Though I haven't committed it yet.
Be a part of the solution, not a part of the problem.

rickg22

I did something similar to the plugin. It works on startup / shutdown, but when loading/unloading project, it's still blind.

However I did manage to speed it up significantly now, added some flags for reentrancy, file modification checks, and memory usage only goes to 33MB.

Unfortunately, the memory leak is STILL present. Everytime i hit "Refresh list", memory consumption goes up by 20 MB. I need memory debugging tools or something.

I'll commit tomorrow anyway, it seems the plugin's 100% usable now.

polygon7

Quote from: rickg22 on June 20, 2007, 08:49:56 AM
Unfortunately, the memory leak is STILL present. Everytime i hit "Refresh list", memory consumption goes up by 20 MB. I need memory debugging tools or something.
Hi,
for Linux the best memory debuger is Valgrind, but I don't know any for Windows.
best regards,
p7
Free open source UML modeling tool: ArgoUML

Biplab

Quote from: rickg22 on June 20, 2007, 08:49:56 AM
I did something similar to the plugin. It works on startup / shutdown, but when loading/unloading project, it's still blind.

I've added couple of SDK functions to detect Project/Workspace Loading/Closing state. It's in rev 4114. :)
Be a part of the solution, not a part of the problem.

rickg22

Biplab: Thanks! Also, I improved on them and there's a function for all plugins (I think you've seen it in the SVN log). It's ProjectManager::IsBusy(). It also checks the isShuttingDown to be safe.