CLion过度使用系统内存 [英] CLion uses system memory excessively

查看:2146
本文介绍了CLion过度使用系统内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在Windows 7 64位系统上使用CLion编辑C文件.

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

令我非常困扰的一件事是它占用了过多的系统内存.它不会引起另一个问题.实际上,CLion在IDE中的内存消耗(〜2000 mb中的〜500 mb)要比系统中的内存消耗(〜1000 mb)少得多.您可以在下面看到系统内存使用情况的快照和CLion的内存显示:

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:

我不是将CLion用于C ++,而是用于C项目.我的项目不是那么大(〜5个c文件<300行和〜10 h文件).我不使用它来编译项目,我只是用它来进行编辑.在快照期间,没有用户程序在运行.而且CLion没有显示任何正在运行的进程(索引等).这是一种普遍的行为.

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.

我不确定我的体验是否是预期的/正常的,还是由于我的系统设置,项目设置或我使用IDE的方式引起的.

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?

推荐答案

帖子已经2岁了,但是CLion 2018.1也存在这个问题,我想其他人也有.一些对我有用的提示:

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:

  • 从索引中排除目录.
  • 删除不需要的源文件.
  • 解决两个类之间的循环依赖关系. (注意:我不能保证这是完全正确的,因为我一次尝试了几件事,而如此强大的IDE会受到此类问题的影响似乎很奇怪,但我不能排除它.)
  • 如果确实很糟糕,则可以暂停索引.保证减少内存使用.当然,智能补全将不起作用.
  • 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.

目前,使用RocksDB,RapidJson和约50个类时,RAM的使用情况稳定在〜1 Gb.

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

更新:调整clion64.exe.vmoptions可以从根本上减少能耗.

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

这篇关于CLion过度使用系统内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆