Hangs for several minutes with 100% CPU use

CodeLite installation/troubleshooting forum
mattday
CodeLite Enthusiast
Posts: 21
Joined: Mon Jan 09, 2012 11:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Hangs for several minutes with 100% CPU use

Post by mattday »

codelite 8.1.0 from ubuntu repository
kubuntu 14.04.3 LTS (inside VirtualBox VM on XP x64 host)
GCC 4.8.4

Symptoms:

I type two characters into the editor, then as soon as any further characters are entered, the application stops responding to any input for several minutes with 100% CPU usage. Eventually it returns and the additional characters appear together with the code completion options. I can then continue (until the next line of code!). This happens almost every time I type a new line.

Further info:

I tried a full retag. I tried removing and reinstalling codelite. I tried updating my system and rebooting. I tried creating a new minimal project to reproduce the problem, but it only occurs in the project I am working on. It is not a big project: only about 10 small source files at present. It uses the OpenCV and dlib libraries. I have been using codelite to develop it up until today and it was working without this problem until I resumed work on it this morning.

CTags search paths:

/usr/include
/usr/include/c++/4.8
/usr/include/c++/4.8/backward
/usr/include/i386-linux-gnu
/usr/include/i386-linux-gnu/c++/4.8
/usr/lib/gcc/i686-linux-gnu/4.8/include
/usr/lib/gcc/i686-linux-gnu/4.8/include-fixed
/usr/local/include

CTags exclude paths: (none)

Thanks for any suggestions,
Matt
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by eranif »

Settings->Code Completion->Triggering

and disable the option:
Auto display code completion box when typing

In addition, from your description, it seems that your machine is not strong enough you can tune some settings to improve the code completion:

Settings->Code Completion->display and behavior->number of items to display in the completion box

Set this value to 50 (by default it is set to 500)

If this still slow, use clang code completion instead of the builtin by enabling both:
settings->Code Completion->clang->enable clang code completion
settings->Code Completion->clang->only use clang code completion

If you choose to use clang only, you will need to rebuild your workspace

Eran
Make sure you have read the HOW TO POST thread
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by DavidGH »

Hi,

If that doesn't work, there's another possibility: have a look at the this post about ibus.

Regards,

David
mattday
CodeLite Enthusiast
Posts: 21
Joined: Mon Jan 09, 2012 11:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by mattday »

Many thanks - disabling that option certainly eliminated the problem. It will still happen if I hit ctrl+space without thinking of course.

I'm not running ibus, so that can't be causing it, but thanks also for that suggestion.

The machine should be up to the job. It has an i5-2500K CPU with 16Gb RAM and the VM has access to 2 cores and 8Gb RAM. Something can't be right for it to get tied up for so long.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by eranif »

mattday wrote:Many thanks - disabling that option certainly eliminated the problem. It will still happen if I hit ctrl+space without thinking of course.
I am guessing that you are talking about:
Settings->Code Completion->Triggering

and disable the option:
Auto display code completion box when typing
Question:
Where is your workspace located? (path on the file system)

Eran
Make sure you have read the HOW TO POST thread
mattday
CodeLite Enthusiast
Posts: 21
Joined: Mon Jan 09, 2012 11:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by mattday »

That's right, I was talking about the code completion triggering.

The workspace is at /home/matt/Documents/ProjectName/ProjectName.workspace
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by eranif »

What is the size of the symbol database file?

Code: Select all

/home/matt/Documents/ProjectName/.codelite/ProjectName.workspace


Eran
Make sure you have read the HOW TO POST thread
mattday
CodeLite Enthusiast
Posts: 21
Joined: Mon Jan 09, 2012 11:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by mattday »

There is no file with that exact path (the closest match is WorkspaceName.workspace.matt_day which is tiny). WorkspaceName.tags is about 25Mb and ProjectName.tags is just under 4Mb, but I didn't experience the problem just now when I checked. As I should be returning to do some more work on this project very soon, I will update when I have reproduced the issue again and re-examined the size of those tags files.
mattday
CodeLite Enthusiast
Posts: 21
Joined: Mon Jan 09, 2012 11:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by mattday »

I did not continue with the above, but have now hit the same problem with a different machine and newer version of CodeLite. Are there any suggestions on how I can try to figure out what is going wrong here? It is quite a serious issue from a usability perspective.

The details this time: Ubuntu 14.04 under a VirtualBox VM on Windows 10 64-bit host with i5-5200U CPU and 8Gb RAM. CodeLite version 9.1.0 from repository.

The problem appears to be the same as before. CodeLite hangs on typing the third character on a new line.
Disabling code completion triggering avoids it, but will still hang if manually triggered.
Never seems to recover this time (or takes too long for me to wait, so I always kill CodeLite).

I had been working on the project almost every day for a number of weeks and the project size was growing steadily, then this problem suddenly comes up again on Friday. I think it might have coincided with installing some system updates. As far as I can remember, the project structure itself did not change prior to the problem arising.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Hangs for several minutes with 100% CPU use

Post by eranif »

Is it possible to attach a debugger to the running process and see what CodeLite does?
Make sure you have read the HOW TO POST thread
Post Reply