求教openfile 问题 急

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
botman
帖子: 2
注册时间: 2009-05-23 18:53

求教openfile 问题 急

#1

帖子 botman » 2009-05-23 18:59

我是linux的初学者
在使用fopen时 读取到1000多个文件后显示fail to read: Too many open files
我在网上看了一些文章 让我修改 /etc/security/limits.conf 这个文件 但是我无法打开这个文件
请问应该如何做到
非常感谢
头像
libralibra
帖子: 401
注册时间: 2008-02-23 17:31
联系:

Re: 求教openfile 问题 急

#2

帖子 libralibra » 2009-05-23 19:09

用root权限打开

代码: 全选

sudo gedit /etc/security/limits.conf
My Blog: matlab, ubuntu, python
http://goo.gl/GDIO
botman
帖子: 2
注册时间: 2009-05-23 18:53

Re: 求教openfile 问题 急

#3

帖子 botman » 2009-05-23 19:26

文件打开了 接下来应该做什么呢 多谢多谢
头像
kurai
帖子: 764
注册时间: 2009-04-17 10:42

Re: 求教openfile 问题 急

#4

帖子 kurai » 2009-05-23 21:25

这个问题只在myeclipse启动的时候碰到过,在文件里加

代码: 全选

* hard nofile 65535
* soft nofile 65535
不过,这是解决myeclipse的一个报错,错误信息倒是跟你的一样~~~至于这两条参数跟你的这个问题有没有关系,你自己试一下吧~~~~
The reason behind this is that on Unix based systems the kernel itself can be configured to limit the number of file handles open at

any given time. When firing up an Eclipse-based product, due to the plug-in based design, it's normal to have hundreds if not thousands

of new file handles to get opened reading resources from all those plugins.

The way to fix this is to tell the kernel to increase it's limits for allowable open files, this can be done by editing the /etc/security/limits.conf file

and increasing the file handle limits with the following lines:
Code:

* hard nofile 65535
* soft nofile 65535
回复