中文网好像不好找......解决了这个问题后电脑速度明显的快多了(英文是必须要耐心的看下去的)
2014-08-26 00:51
579 查看
转载于http://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
Added by
Roman Shevchenko, last edited by
Konstantin Bulenkov on Jun 30, 2013 (view change)
Go to start of metadata
For an intelligent IDE it is essential to be in the know about any external changes in files it 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
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). You can do it by adding following line to the
/etc/sysctl.conf file:
Then run this command to apply the change:
And don't forget to restart your IDE.
Note: the watches limit is per-account setting. If there are other programs running under the same account which also uses Inotify the limit should be raised high enough to suite needs of all of them.
Labels:
None
19 Comments
comments.show.hide
Dec 16, 2010
Permalink
Dec 16, 2010
It is a system file, not an IDEA one.
Permalink
Dec 16, 2010
Permalink
Jan 19, 2011
Permalink
Jan 19, 2011
To the end of /etc/sysctl.conf add the line: fs.inotify.max_user_watches = 5242881
Apply the changes with the command sysctl -p
Permalink
Jan 19, 2011
Permalink
Nov 03, 2011
Should I adjust this settings on developers' working stations and also on server with the value 10 times as big?
Permalink
Nov 03, 2011
Permalink
Nov 08, 2011
Permalink
Nov 08, 2011
Permalink
Nov 08, 2011
Meanwhile I'd also put the change into a separate file under /etc/sysctl.d .
Permalink
Nov 08, 2011
I'm not telling not to do, just saying sysctl.conf is quite a correct way too.
Permalink
Sep 17, 2013
sudo sysctl fs.inotify.max_user_watches=xxxxx
This updates the entry in /proc/sys/fs/inotify/max_user_watches but does not seem to modify the /etc/sysctl.conf file.
Permalink
Sep 18, 2013
Permalink
Sep 19, 2013
Thanks Roman.
Permalink
Oct 15, 2013
I f you google a little bit, you'll find that the memory used by inotify is 540 * nb of watches on 32bit systems and so 1080 on 64bit ones. 524288 * 1080 = 566 231 040 => 540MiB only for that !
Stackoverflow suggest to count your files to give you a closer idae of how much you really need. I done wih only 92000 max watches on my 8Go source dir .
http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux
http://askubuntu.com/questions/154255/how-can-i-tell-if-i-am-out-of-inotify-watches
Permalink
Oct 21, 2013
Permalink
Nov 11, 2013
this news. But the news also give a work around.
Following for the lazy people:
# vi /etc/sysctl.d/99-sysctl.conf
Then add the line mentioned above:
fs.inotify.max_user_watches = 524288
Or you can just:
# echo "fs.inotify.max_user_watches = 524288" >> /etc/sysctl.d/99-sysctl.conf
Don't forget:
# sysctl -p
Permalink
Jan 21, 2014
sysctl: cannot open "/etc/sysctl.conf": No such file or directory
The correct command seems to be:
# sysctl -p /etc/sysctl.d/99-sysctl.conf
Added by
Roman Shevchenko, last edited by
Konstantin Bulenkov on Jun 30, 2013 (view change)
Go to start of metadata
For an intelligent IDE it is essential to be in the know about any external changes in files it 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
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). You can do it by adding following line to the
/etc/sysctl.conf file:
Note: the watches limit is per-account setting. If there are other programs running under the same account which also uses Inotify the limit should be raised high enough to suite needs of all of them.
Labels:
None
19 Comments
comments.show.hideDec 16, 2010
James Treacy
Hi - any idea where I'd find sysctl.conf in IntelliJ 10 (Community Edition) installed on Ubuntu?Permalink
Dec 16, 2010
Roman Shevchenko
/etc/sysctl.confIt is a system file, not an IDEA one.
Permalink
Dec 16, 2010
James Treacy
Whoops! Thank youPermalink
Jan 19, 2011
smarks@digisolutions.com
FYI: this solution does not seem to work under CentOS not sure what the correct fix is at this point.Permalink
Jan 19, 2011
smarks@digisolutions.com
OK, should have looked first, here's the procedure for CentoOSTo the end of /etc/sysctl.conf add the line: fs.inotify.max_user_watches = 5242881
Apply the changes with the command sysctl -p
Permalink
Jan 19, 2011
Roman Shevchenko
Sorry, but what's the difference? You just increased the limit to over 5 million (5,242,881 instead of proposed 524,288). Is there any point to set the limit that high?Permalink
Nov 03, 2011
Alex Andrienko
Considering the following situation: 10 developers work on the working copies, mounted via sshfs from a single server. Don't ask me why, it's not my call.Should I adjust this settings on developers' working stations and also on server with the value 10 times as big?
Permalink
Nov 03, 2011
Roman Shevchenko
Though I've never tried it over sshfs but I'm pretty sure it won't work. Network-mounted FS don't produce file change notifications.Permalink
Nov 08, 2011
Arik Kfir
On Fedora, and I suspect other Linux OSes too, the correct solution is not to edit /etc/sysctl.conf but rather to create a new file in /etc/sysctl.d such as "/etc/sysctl.d/idea.conf" and place the config line there.Permalink
Nov 08, 2011
Roman Shevchenko
Sysctl.d is more for packages. It's ok to place user-configured settings in sysctl.conf.Permalink
Nov 08, 2011
Alex Andrienko
Speaking of packages, it would be nice to have one.Meanwhile I'd also put the change into a separate file under /etc/sysctl.d .
Permalink
Nov 08, 2011
Roman Shevchenko
http://youtrack.jetbrains.net/issue/IDEA-22750I'm not telling not to do, just saying sysctl.conf is quite a correct way too.
Permalink
Sep 17, 2013
Rajiv
In ubuntu 12+, you needn't edit the sysctl.conf file. Just dosudo sysctl fs.inotify.max_user_watches=xxxxx
This updates the entry in /proc/sys/fs/inotify/max_user_watches but does not seem to modify the /etc/sysctl.conf file.
Permalink
Sep 18, 2013
Roman Shevchenko
Right, but it will last only until reboot.Permalink
Sep 19, 2013
Rajiv
Yup. True that. Modified sysctl.conf (like I should have in the first place!) and it worked like a charm.Thanks Roman.
Permalink
Oct 15, 2013
JRo
I don't understand why it is necessary to set up this limit so high. And it not a good thing to give such a hight value as the must-do in a wiki !I f you google a little bit, you'll find that the memory used by inotify is 540 * nb of watches on 32bit systems and so 1080 on 64bit ones. 524288 * 1080 = 566 231 040 => 540MiB only for that !
Stackoverflow suggest to count your files to give you a closer idae of how much you really need. I done wih only 92000 max watches on my 8Go source dir .
http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux
http://askubuntu.com/questions/154255/how-can-i-tell-if-i-am-out-of-inotify-watches
Permalink
Oct 21, 2013
Roman Shevchenko
The links provided clearly say that unused watches does not take any memory.Permalink
Nov 11, 2013
Jay Lee
For Arch Linux users, this solution won't work after version 207 according tothis news. But the news also give a work around.
Following for the lazy people:
# vi /etc/sysctl.d/99-sysctl.conf
Then add the line mentioned above:
fs.inotify.max_user_watches = 524288
Or you can just:
# echo "fs.inotify.max_user_watches = 524288" >> /etc/sysctl.d/99-sysctl.conf
Don't forget:
# sysctl -p
Permalink
Jan 21, 2014
Claus Conrad
While running sysctl -p on Arch Linux I got:sysctl: cannot open "/etc/sysctl.conf": No such file or directory
The correct command seems to be:
# sysctl -p /etc/sysctl.d/99-sysctl.conf
相关文章推荐
- 为什么公司里个个都很负责,结果却不好呢?作为管理者如何解决这个问题?
- yum源中默认好像是没有mysql的。为了解决这个问题,我们要先下载mysql的repo源。
- cdh5.7.1默认安装无法装载native lib的问题解决(cdh5.5.x好像也有这个问题)
- 解决 E: dpkg 的操作被中断了, 您必须手动执行 'sudo dpkg --configure -a' 以修复这个问题。
- winXP系统如何加快电脑启动速度解决电脑启动慢问题
- 这个网址必须收藏,解决viewpager嵌套viewpager和其他view 冲突问题
- apicloud git-svn 地址冲突,导致代码管理功能不可用.这个问题是由 windows 系统自身DLL加载机制引起的.一般重启电脑即可解决
- 安装Ubuntu之后默认英文,选简体中文,正常来说这样装好就应该能用的,可是这个时候又出现了错误,說:broken package database. 请用apt-get install -f解决问题
- 给定一个单链表,从链表返回一个随机节点的值。 每个节点必须具有相同的选择概率。 跟进: 如果这个链表非常大,而且它的长度不为人知呢? 你能解决这个问题,而不使用额外的空间?
- [今天这个问题我必须记录一下] 英文字符和数字的编码范围是 [\x00-\xff]
- 解决笔记本电脑使用网线正常,使用无线网络速度慢的问题
- 解决电脑速度慢的问题
- 请问如何解决WORD转HTML是出现的“内存或磁盘空间不足,无法显示或打印图片”这个问题?
- Excel开发系列二 解决.net生成Excel文件速度问题的若干方案
- 终于解决了这个怪问题
- 终于把:无法命中断点,还没有为文档加载任何符号这个问题解决了!
- 解决了半个月来电脑的奇怪问题
- 如何解决ADO.NET访问Access数据库出现"操作必须使用一个可更新的查询"的问题(非原创,摘自书中)
- 解决AVI等文件浏览电脑速度变慢的方案(regsvr32 /u shmedia.dll)
- 给网站增加解压缩功能,解决上传速度慢或者不支持FTP的问题(要求支持asp.net和SharpZip)