Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: rickg22 on June 20, 2007, 02:45:08 am
-
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 (http://developer.berlios.de/bugs/?func=detailbug&bug_id=11421&group_id=5358)
-
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)
-
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)
-
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
-
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.
-
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.
-
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 (http://valgrind.org/), but I don't know any for Windows.
-
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. :)
-
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.