返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
杂七杂八

Modify Inotify Watches Limit to Improve IDEA Performance

Official documentation For an intelligent IDE, it is essential to be in the know about any external changes in files it is working with - e.g. changes made by VCS, or build tools, or code generators etc. For that reaso

曦远 (DealiAxy)约 5 分钟
目录4 个章节

Official documentation

For an intelligent IDE, it is essential to be in the know about any external changes in files it is working with - e.g. changes made by VCS, or build tools, or code generators etc. For that reason, IntelliJ platform spins background process to monitor such changes. The method it uses is platform-specific, and on Linux, it is the Inotify facility.

Inotify requires a "watch handle" to be set for each directory in the project. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects, and reaching the limit will force IntelliJ platform to fall back to recursive scans of directory trees.

To prevent this situation it is recommended to increase the watches limit (to, say, 512K)

In short, when IDEA is running, a background process constantly scans the project folder for file changes. On Linux this is implemented using the Inotify feature, but Linux has a watch handle limit — simply put, a watch size limit. Typically this limit is smaller than what our projects need, so IDEA has to frequently scan the project directories itself instead of using the system feature, which causes it to lag.

The way to fix this is to change the system configuration and raise this limit.

Solution

Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:

fs.inotify.max_user_watches = 524288

Then run this command to apply the change:

sudo sysctl -p --system

Official documentation

https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit

About


Learn more on my WeChat Official Account:DealiAxy Every post was in my blog:blog.deali.cn

_EOF_

Modify Inotify Watches Limit to Improve IDEA Performance

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

我的新博客上线了,附上Hexo博客折腾记录

鉴于简书和知乎经常以各种理由删除我的博客,之前我的WordPress博客又已经坏掉了,所以我一直想搞一个新的博客,这不看上了hexo静态博客了,直接托管在github上方便又免费。 配置啥的官方文档都很详细了,不再赘述。 博客地址:http://blog.deali.cn/ 各种配置,我还花了一天时间来写脚本把我的旧的博客导入,图片下载,做了替换等等工作,期间也出了很多问题,感觉很烦,很浪费时间,

2021-12-18 · 杂七杂八 · 约 1 分钟

抓住九月小尾巴的小总结,祖国生日快乐~

为期一个月的实训到27号就结束了,我估摸着这夏天也快结束了,到处是秋天的味道。 这个月在广州还是以学习为主,在培训班能学到的很有限,不过我自己倒是折腾了不少东西出来,感觉还蛮好的。 技术学习方面 培训班也不能说没用吧,至少是前端扫盲了,在此基础上我自己又看了一下书,学了布局、动画和一点点js啊,js其实真的挺好用的,收回我之前的成见~(少见多怪) 还用js做了几个好玩的东西,比如说斗鱼、B站刷弹幕

2022-11-05 · 杂七杂八 · 约 1 分钟

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…