Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLion uses system memory excessively

Tags:

c

memory

ide

clion

I recently started to use CLion, on Windows 7 64-bit, for editing C files.

One thing that bothers me a lot is that it uses too much system memory. It doesn't cause out of memory error as asked in another question. Actually CLion shows much lesser memory consumption in IDE (~500 mb out of ~2000 mb) than it takes from system (~1000 mb). You can see a snapshot of the system memory usage and CLion's memory display below:

enter image description here

I use CLion not for C++ but for C projects. My project isn't that big (~5 c files < 300 lines and ~10 h files). I don't use it to compile the project, I just use it for editing. And during the snapshot there was no user program running by it. And CLion wasn't showing any processes running (indexing etc). It is a general behaviour.

I'm not sure if what I experience is something expected/normal, or it is caused because of my system setup, project settings or the way I use the IDE.

Is there any known causes for excessive memory usage? Can you suggest practices to decrease memory usage?

like image 771
hansolo Avatar asked Apr 08 '16 10:04

hansolo


People also ask

How much RAM does CLion use?

Currently the RAM usage is stable at ~1 Gb with RocksDB, RapidJson, and ~50 classes.

How do I increase my CLion memory limit?

If you are experiencing slowdowns, you may want to increase the memory heap. From the main menu, select Help | Change Memory Settings. Set the necessary amount of memory that you want to allocate and click Save and Restart.


2 Answers

The post is 2 years old, but I am also having this issue with CLion 2018.1, and I imagine, others do, too. Some tips that worked for me:

  • Excluding directories from indexing.
  • Deleting source files I don't need.
  • Resolving a circular dependency between two classes. (Note: I can't vouch it was exactly that, because I tried several things at once, and it seems odd that such a powerful IDE would be affected by such an issue, but I can't rule it out.)
  • If it's really bad, the indexing can be paused. Guaranteed to reduce the memory usage. Of course, the intelligent completion won't work then.

Currently the RAM usage is stable at ~1 Gb with RocksDB, RapidJson, and ~50 classes.

UPDATE: tweaking clion64.exe.vmoptions reduced the consumption radically.

like image 182
Vadim Berman Avatar answered Sep 27 '22 15:09

Vadim Berman


Same issue here. I haven't used CLion just sitting there so that I do not have to open again, 2 projects few files open, nothing major, still eating up +3GB is not something that I can accept, switching back to Sublime, that works fine, as others have mentioned I am using it only for editing/refactoring, compilation happens in Terminal.

(PyCharm has similar issues)

enter image description here

like image 30
ervinbosenbacher Avatar answered Sep 27 '22 16:09

ervinbosenbacher