CLion on Mac is a CPU hog

Has anybody noticed that? It seems to be very busy "parsing syntax" all the time, but even when minimized, Activity Monitor shows it takes between 92% and 200% of my CPU! that's with the latest 1.2 EAP, but even 1.1 has that behavior... On laptops, it's really bad, the battery goes very quickly. I barely have any plugins installed. Is there anything else I can do to get the CPU consumption back into normal range?

Thanks!

Frank

2
53 comments
Avatar
Permanently deleted user

Are there any updates? I have the same issues on a Macbook Pro 2016. It is so bad that i have to switch to vim again. It seems as clion is always indexing/parsing or whatsoever. I have all plugins disabled except the terminal

3
Avatar
Permanently deleted user

Still looking for update.  It's so prohibitively bad that my typing is actually lagged, none of the features work in a timely manner, and using it without being connected to a power supply is out of the question.  Running a 2015 i7 Mac with El Caption.

2

@Anna Falevskaya Sent. I must say that if performance isn't substantially improved very soon then I'll be saying goodbye to CLion. This has been a problem for years now and it rarely seems to get better with new releases, often worse. There's no point in keeping asking for CPU snapshots if addressing the problem isn't a priority, and based on your previous promise - "We are working hard on CLion performance improvements, but it seems that some important fixes will be ready only for CLion 2019.1." - I don't believe that it is a priority at all.

2

Could you please capture CPU snapshot and attach it to a new bug report? You can do it via Start CPU Usage Profiling and Stop CPU Usage Profiling actions.

1
Avatar
Permanently deleted user

Yes, this is unfortunate. CLion has a lot of great features, but my 2013 MacBook Pro started running really hot twice while using it. At this point, for me, it's just not worth the risk.

1
Avatar
Permanently deleted user

It's a clion thing.  It kinda makes it pretty meh with regards to a lot of the features of clion though.  You don't get any code parsing so refactoring, traveling to other symbols etc, all kinda stops working.  At least the last time I tried it.  But that may be ok with you for what your needs are.  Anyway, here is a screenshot showing you the setting:

Untitled.png

Click on that little guy icon on the bottom right of your status bar and that window pops up.. You can then click "Power Save Mode" to turn it all down or you can lower your highlight level to syntax which will help quite a bit but not take away everything.

1

CLion 2018.1
Build #CL-181.4203.549, built on March 26, 2018
JRE: 1.8.0_152-release-1136-b20 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.3

 

I still experience high CPU usage when editing files. I'm not compiling, IDE is not indexing anything but CPU usage varies from 100% to 150%. My Macbook wants to fly away. I've sent CPU snapshot to JetBrains support.

1
Avatar
Permanently deleted user

Sorry, my english is terrible.

Yes, I had a problem with incredible CPU load during highlighting and syntax checking right after installing CLion.
And it disappeared strictly after a reboot.

In the "Activity monitor" built into the CLion, the main process that hung out my system was exactly (cidr.lang.symbols).

And it is quite possible, because many poppy users reboot it about once every couple of months with the arrival of updates.
Since the problem disappeared, I did not have time to make a CPU snapshot that would show this situation in more detail.
I really didn't think it would work.

1

The new version of CLion (2019.1) seems to be yet another step backwards. As I type this, CLion - which is open in another desktop window doing nothing of note - is causing 580% CPU usage on my laptop. People in my office are starting to stare at me, presumably because of the torrent of noise coming from my laptop fans due to CLion's obscene CPU usage.

1

Clion makes my mac fucking hot

1
Avatar
Permanently deleted user

I've waited for a long time and moved to vscode - it has real remote development - so the indexing is all on a powerful Linux machine so my Mac is no longer bogged down.

1

@... Just started trying vscode... all of the features I need with < 1% CPU usage. Goodbye CLion.

1

Sven Schober Please report an issue to the issue tracker with IDE log and, if possible, CPU profile. We haven't seen it for a long while, maybe it's smth new

1
Avatar
Permanently deleted user

I'm having the same problem on my MBP running Yosemite. After importing a project, it seems that every 10 minutes or so, it pegs all the CPU cores, runs the fan, gets very hot, and runs down the battery. This is even if I'm doing light -- or no -- editing. There's no feedback on what it's doing, but it's as if it has to scan and analyze the whole code base every several minutes.

I will get a CPU trace as you suggested.

Bug filed as https://youtrack.jetbrains.com/issue/CPP-4612

0
Avatar
Permanently deleted user

I'm trying to gather the CPU data as requested, but I can't figure out how to do it.
I can't find a .vmoptions file anywhere to edit, as suggested here: https://intellij-support.jetbrains.com/hc/en-us/articles/206827577-Reporting-performance-problems
And there is no "Start CPU Usage Profiling" option anywhere that I can find.
I'm on a Mac, using the evaluation version.
Can you give more specific instructions for how to get a CPU snapshot?

0
Avatar
Permanently deleted user

Figured it out. I was never able to get it working from my ~/Library/Preferences, but I did get the menu item after editing the /Applications/CLion.app/Contents/bin/clion.vmoptions

I will file a bug report.

0
Avatar
Permanently deleted user

Any update here? There was another thread talking about the same issue somewhere, but I can't find it anymore. I've seen some posts hinting at the fact that it could be happening because of symbols parsing and syntax highlighting, but not sure. Any kind of reply from JetBrains at all?

0
Avatar
Permanently deleted user

This seems to be pretty normal in general.  It happens to me in Linux as well.  My guess is it's just a java thing.  Java isn't really know for efficiency or speed.  I can definitely feel the difference in java programs vs c/c++ ones.  My cpus get pegged all the time with clion.  I've seen it up over 400% (have a 6 core/6 HT system) so that is pretty impressive load for an ide. ;)

There is a low power/low cpu mode you can turn on but it disables a LOT of features.  If you are concerned with cpu usage or battery life you can toggle that on.

As for heat on macs I find they like to not spin up their fans as much as possible.  If you are concerned get something like smcfancontrol (I think that's the name, been a while since I ran macs full time) and turn your fans up manually.  It will be louder of course but keep the heat way down.

0
Avatar
Permanently deleted user

Well, I don't want the heat or the noise, so messing with the fan isn't really a solution. And I want to be able to run on battery power for a long time.

But I'm very intrigued by the "low power mode" you mentioned. Is this a feature of CLion? Where do I find that option, and is it something I can easily turn on and off in a session? (For example, go back to regular mode when I know I am doing things that require re-analysis, but keep it in low power mode when I'm just editing or looking over the code?)

0
Avatar
Permanently deleted user

That doesn't sound like a good resolution to this problem. I tried Eclipse, and it doesn't have that problem. I didn't do a detailed comparison of features, but it does provide syntax highlighting and navigation to keywords without requiring 400% CPU. There is no reason CLion couldn't do the same.

0
Avatar
Permanently deleted user

See I find Eclipse super slow too.  Coming from something like SlickEdit you really feel the speed differences.

On my systems (granted I run really high end systems) the cpu only goes high for a few seconds when it needs to reindex things.  Under normal usage I don't get those high cpu usages.  It is definitely way high cpu usage for an IDE.  I don't see that with other IDEs I've used.

But, that being said, I love CLion.  It is new so it has some issues, but it is a fantastic IDE.  Before this the only other IDE I used regularly was SlickEdit.  Most of the time I used VIM with some plugins to do some IDE type stuff.  Never really cared for most ides, until this one.  It does so much and helps me develop faster for sure.

I haven't run it on a mac but my boss does as do a few other developers at work.  None of them have reported major CPU issues, so you may have an issue with something that they aren't seeing.

0
Avatar
Permanently deleted user

Yo.

Having the same problem as you on a 13" MacBook pro (but not on my 15" MSI) I tried to find ways to limit CLion's CPU usage, since when he decides to index the 50 000+ lines of code of the project while I'm building it, the computer freezes completely for at least 10 minutes.

The solutions I found were to use the commands nice and cpulimit (I'm working in a Linux environment, not MacOS) but CLion seems to bypass those limits.

If anyone finds any kind of way to prevent CLion from taking all the computer's resources, other than disabling Inspections (the only reason I use CLion), I'd be glad to hear about it!

I'll keep you up to date if I find anything useful.

0
Avatar
Permanently deleted user

I think you're kinda stuck with nice to manage the resource usage.  If you nice the main clion process all sub processes should inherit the nice level.  You can also renice the process in top or some other system monitor as you notice resource issues.

One of the big things is resetting your build jobs.  By default clion will make with a -j12.  A good rule is to use # of cpus or #cpus +1 for make jobs.  Even my hardcore workstation is only running with 6 cpus (12 with hyper threading but those don't count).  So a -j12 on a large project is super aggressive.  You can lower that down (per project even) to like a -j2 or something.  Your build times will suffer a bit.  If you wanted, limit it to a single one of your real cores (or at least leave a core for other stuff).  So if you have a 4 core, do a -j3.  That will leave plenty of cpu for your OS and responsiveness.

Also, depending on your flavor of linux, make sure you have preemptive desktop enabled in your kernel.  If you are in server mode there is no priority given to user interface stuff so it feels "locked up" a lot.  Most linux distros will have that enabled (if they are meant for desktop machines).  Some like the one I run (gentoo) is a power user source based distro.  It leaves kernel building and config up to the user.  So just make sure that is enabled in your kernel.  If you are running something user friendly like ubuntu it will almost assuredly be enabled already.

And lastly you can beg jetbrains to rewrite their stuff in a fast language like c++ instead of java so things are way way faster and you don't get massive cpu usage during indexing. ;)

Oh and it's possible since your mac is a lower end laptop you may have a super slow hard drive which could be more of an issue than the cpu during indexing and such.  If you don't have at least a 7200rpm sata drive that would definitely cause some slow days and locked up feeling.  Best would be to get an SSD for your main drive and store large data like videos/music/etc on another mechanical hd.

0
Avatar
Permanently deleted user

Performance appears to have degraded for me with the 2017.1 version - how can I provide a debug log?

0

I see similar issues --  100-400% CPU utilization while (constantly) re-indexing on version 1.2.5. This is happens even if the *only* activity I do is a bit of editing! Environment is linux OS [Redhat RHEL6], host is x86_64, I7 with 16GB RAM.

0
Avatar
Permanently deleted user

I'm on 2017.3 EAP and the CPU usage is always >> 100 % consumed by CLion. Even if I'm away from keyboard. Jetbrains can do better. 

0
Avatar
Permanently deleted user

I am running 2017.2 on a 2017 Macbook Pro.  CLion routinely takes 400% CPU.  In case it helps, features that may be correlated are:

* Refactoring of variables (this can really grind sometimes)

* C++ debugger

I am happy to provide logs or information so Jetbrains can determine the root cause.  It seems Jetbrains just is not interested.  It is so bad I am considering swithing IDEs.  Its strange that I do not see this with Pycharm.

0

Hi all! Investigation of situations when CLion is unexpectedly slow or/and CPU usage is unexpectedly high requires some additional information from you. Each time you face such an issue, please don't hesitate to let us know by sending a sample project, if possible, and a CPU snapshot, as described here, to our e-mail address (clion-support at jetbrains.com).

0
Avatar
Permanently deleted user

Same for me. I have been encountering Clion performance problems for several months now. I have just a scratch of a project with only 2 unit tests (Boost.Test) written to check the setup, but when I try to write or edit some code processor usage increases to 70-90%. I've increased memory and now it is about 6GB. Clion takes at most 2 GB, but shortly after the peak moment it drops to just about 400 MB.

CLion 2018.1.1
Build #CL-181.4445.84, built on April 10, 2018
JRE: 1.8.0_152-release-1136-b27 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.4

 

0

I also have horrible CPU usage with CLion on my medium sized (<100,000 lines) project. Even when browsing code (not even editing!) CPU usage regularly hits 400%. Sometimes when I start writing the name of a template method CLion just crashes, forcing me to 'force quit', which looses all my changes after my last save. I've tried increasing available memory to JRE.

 

CLion 2018.1.3
Build #CL-181.5087.36, built on May 23, 2018
JRE: 1.8.0_152-release-1136-b39 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.4

0

Please sign in to leave a comment.