Author Topic: Memory Usage After Open Project in Ubuntu 13.04  (Read 10909 times)

Offline darksshades

  • Single posting newcomer
  • *
  • Posts: 3
Memory Usage After Open Project in Ubuntu 13.04
« on: November 23, 2013, 10:39:00 am »
Hello,

Something really strange started happening for some time now.
After opening a project with codeblocks, its memory usage starts rising until there is no more RAM left.

This is probably some ubuntu related problem or some random incompatibility thing, but it only happens with codeblocks when opening a project.

I tried a full reinstalation using both ubuntu universe repository and ppa:damien-moore/codeblocks-nightly for the latest nightly build.
And was removing codeblock with sudo apt-get autoremove codeblocks --purge; sudo apt-get remove libcodeblocks0 --purge;
Or using synaptic and removing everything with 'codeblocks' in it.



The console log after the 'Open...' operation is:
Code
Starting batch parsing for project 'Box2D - SFML'...
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
ReadClsNames() : Unexpected token '((__aligned__))'.
Already current parser present?!
Project 'Box2D - SFML' parsing stage done!
Project 'Box2D - SFML' parsing stage done (241 total parsed files, 7997 tokens in 0 minute(s), 0.268 seconds).
Updating class browser...
Class browser updated.

But after that it stays normal without any errors.
Also if some project was open, codeblock task stays alive even after closing the window.

As I said, this is probably something on me ubuntu thats making it all go wrong, I'm going to change my distribution in a couple of months so not really that concerned about it.
But just wondering if anyone seen anything like this before?

Edit:
  I installed codeblocks 13.12, and now codeblocks was crashing after the update-compilers popups. I found the same problem here http://forums.codeblocks.org/index.php/topic,18088.0.html and here http://forums.codeblocks.org/index.php/topic,18113.0.html and it seems it is a problem with ubuntu's gtk+.
Then I remembered that I had installed gtkmm some time ago(maybe about the time code completion stopped working, not sure), so I uninstalled it with:
    sudo apt-get remove libgtkmm-3.0-dev --purge --auto-remove
And installed codeblocks 13.12 from the latest debian-stable from the site.
Also, I removed the ~/.codeblocks

I don't know if it was the version 13.12 or the gtkmm problem, but now the code completions is working normaly again o/
« Last Edit: March 02, 2014, 05:10:41 am by darksshades »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #1 on: November 23, 2013, 02:10:52 pm »
I haven't encountered this.

Does this happen for any project or just a specific one?
What do you have in ~/.codeblocks? Try temporarily renaming that folder to see if a fresh start makes a difference.

After that, have you tried disabling plugins? CodeCompletion is a leading candidate for errors. But try starting with --safe-mode, enable the compiler plugin and open your project..
« Last Edit: November 23, 2013, 02:12:58 pm by dmoore »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #2 on: November 23, 2013, 02:28:08 pm »
And very important (as always !!):
which version of C::B do you use ?

Offline darksshades

  • Single posting newcomer
  • *
  • Posts: 3
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #3 on: November 23, 2013, 03:43:33 pm »
I haven't encountered this.

Does this happen for any project or just a specific one?
What do you have in ~/.codeblocks? Try temporarily renaming that folder to see if a fresh start makes a difference.

After that, have you tried disabling plugins? CodeCompletion is a leading candidate for errors. But try starting with --safe-mode, enable the compiler plugin and open your project..

Nice sugestion! Disabling the CodeCompletion plugin when loading a project seems to solve it.


PS: I've had already removed my previous ~./codeblocks configuration files.
Using the latest Code::Blocks 12.11 as of now. (stable version from universe raring)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #4 on: November 23, 2013, 04:10:39 pm »
Do you have a minimal project that you can share that reproduces your problem? To the extent this is caused by a bug in our code we would obviously like to fix it.

Problem occurs with both 12.11 and rev 9455 right?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #5 on: November 23, 2013, 04:15:05 pm »
Do you have a minimal project that you can share that reproduces your problem?
I would like to try testing CodeCompletion plugin(on Windows) if the OP can supply a minimal project.
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.

Offline darksshades

  • Single posting newcomer
  • *
  • Posts: 3
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #6 on: November 23, 2013, 04:55:08 pm »
Do you have a minimal project that you can share that reproduces your problem? To the extent this is caused by a bug in our code we would obviously like to fix it.

Problem occurs with both 12.11 and rev 9455 right?

Yes, I tested with ppa:damien-moore/codeblocks-nightly just now, rev 9455.
But I doubt its reproductible, this happens in ANY project. For example: I just created an empty project, everything is fine. From the moment I add a .cpp file in the project, even a blank one, the memory starts to go up indefinitly.

As I said, I'm pretty sure this might be some broken package from me end at Ubuntu 13.04. Or even some misconfiguration, who knows, the first time this happend I hadn't updated codeblocks. So I strongly feel its either ubuntu updates, or some incompatible packages I installed.
Sorry I can't be of much help.
But thanks for for help people, I'll keep using it without code completion as I'll soon be changing ubuntu version anyways.
« Last Edit: November 23, 2013, 05:16:08 pm by darksshades »

Offline budman85

  • Single posting newcomer
  • *
  • Posts: 2
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #7 on: April 17, 2014, 12:45:10 am »
Hi,

I can confirm the bug as well.  I ran into this problem using 13.12 under Slackware 14.1.  I tried the SlackBuild which uses the Debian binaries, and also compiled from source. 

I opened CB and left it running idle - it ran for a day solid, with no gain in memory.  The moment I open a new or existing project, it still seems ok.  However, the moment I touch the editor, I notice memory usage starts to climb, until all memory is consumed, forcing other apps to swap out.  Closing the window doesn't help, the memory usage continues to climb.  Checked running processes, there is always one CodeBlock process remaining and you can watch the memory usage increase under top.  When I do a kill on the process, all memory is freed and system returns to normal.

I renamed .codeblocks dir with no difference.  I will try disabling the code completion and using the safe mode option.  :)

Regards
Rich

Offline budman85

  • Single posting newcomer
  • *
  • Posts: 2
Re: Memory Usage After Open Project in Ubuntu 13.04
« Reply #8 on: April 17, 2014, 01:13:57 am »
I ran strace on the remaining process to see what it was doing...

strace -c -f -p28065

I saw that 'stat' had over 300 hits in a few minutes.

strace -f -p28065 -o r1

Code
28229 getcwd("/home/budman", 1024)      = 13
28229 stat("/usr/include/seamonkey-2.24/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/ns
s/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/xpcom/xpcom/nss/xpcom/nspr/prtypes.h", {st_mode=S_IFREG|0644, st
_size=19848, ...}) = 0
28229 getcwd("/home/budman", 1024)      = 13
28229 stat("/usr/include/seamonkey-2.24/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/ns
s/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/xpcom/xpcom/nss/xpcom/nspr/pripcsem.h", {st_mode=S_IFREG|0644, s
t_size=2640, ...}) = 0
28229 getcwd("/home/budman", 1024)      = 13
28229 stat("/usr/include/seamonkey-2.24/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/ns
s/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/xpcom/xpcom/nss/xpcom/nspr/plbase64.h", {st_mode=S_IFREG|0644, s
t_size=2895, ...}) = 0
28229 getcwd("/home/budman", 1024)      = 13
28229 stat("/usr/include/seamonkey-2.24/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/ns
s/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/nss/xpcom/xpcom/nss/xpcom/nspr/prvrsion.h", {st_mode=S_IFREG|0644, s
t_size=3559, ...}) = 0

I found there were 3 links, that were odd:

Code
/usr/include/seamonkey-2.24/
lrwxrwxrwx  1 root root    1 Feb 28 21:07 nss -> ./
lrwxrwxrwx  1 root root    1 Feb 28 21:07 plugin -> ./
lrwxrwxrwx  1 root root    1 Feb 28 21:07 xpcom -> ./

I moved them to another dir, outside of include.  Bingo!

I started up CB, loaded a project, started editing it.
Memory usage stayed at 1.6 all the time I was editing.
No change in memory even after 15 minutes.

Prior, it was jumping within seconds of editing.  
And had nearly 80% of memory within <3 minutes.


Seems ok now.

EDIT: It's been running for 17 hours now, and memory usage is the same.  I was finally able to code it in for several hours last night.  Running fine now.

Regards
Rich

« Last Edit: April 17, 2014, 01:31:52 pm by budman85 »