java.io.FileNotFoundException: ***(Too many open files)

http://yizhilong28.iteye.com/blog/1154098

在linux下跑一个多线程读取文件的程序,待读取文件有数十万个。程序读取过程中抛出如下异常*****(Too many open files)。

原因是由于linux限制了一次会话中,程序最大同时打开文件数目。在redhat5中,该数值为1024。可以使用ulimit -n 验证。

解决办法

1、临时修改该数值,可使用

Java代码

  1. ulimit -n XXXX
时间: 2024-10-27 05:39:19

java.io.FileNotFoundException: ***(Too many open files)的相关文章

Caused by: java.io.FileNotFoundException

1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-13 0:49:34 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using

SpringBoot 上传文件到linux服务器 异常java.io.FileNotFoundException: /tmp/tomcat.50898……解决方案

SpringBoot 上传文件到linux服务器报错java.io.FileNotFoundException: /tmp/tomcat.50898-- 报错原因: 解决方法 java.io.IOException: java.io.FileNotFoundException: /tmp/tomcat.5089835798184465073.8081/work/Tomcat/localhost/ROOT/www/server/apache-tomcat-8.5.32/webapps/jxmsto

Play生产模式下java.io.FileNotFoundException那点事

之前”用Scala+Play构建地理数据查询接口”那篇文章里,用到的数据是json格式的文本文件area.json,存放在conf/jsons文件夹下.最开始是放在public/文件夹下,在线上准生产模式下运行: activator dist 得到mosquito-1.0.zip压缩包,解压后: 去/bin目录下运行mosquito脚本报错: java.io.FileNotFoundException 然后就去解压的mosquito-1.0/看发现并没有public文件夹,由此可见public文

keytool 错误: java.io.FileNotFoundException: 拒绝访问

keytool 错误: java.io.FileNotFoundException: 拒绝访问 打开命令行,切换到D:\AndroidStudioProjects\MyApplication\app目录 keytool 在JDK的/bin目录下,比如:/opt/jdk/bin 用以下的命令生成一个证书: keytool -genkey -alias android.key -keyalg RSA -validity 20000 -keystore android.key 老是报如题的错误: 后来

nested exception is java.io.FileNotFoundException: Could not open ServletContext resource

<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> 注意这段配置尽量写在靠前的位置,因为在tomcat启动后web项目会先初始化上下文,我们这段配置正是指定了上下文配置的文件位置,在上下文初始化完成之后才应当继

Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be ope

1.错误描述 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.

java.io.FileNotFoundException: antlr-2.7.7.jar (系统找不到指定的路径。)[待解决]

严重: Failed to destroy the filter named [struts2] of type [org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter]java.lang.IllegalStateException: java.io.FileNotFoundException: E:\apache-tomcat-8.0.37\webapps\20170317-JavaEE-SSH\WEB-IN

om.exception.DaoException: java.io.FileNotFoundException: D:\Users\liuyangOS2237\Workspaces\MyEclipse%2010\Zhuce\WebRoot\WEB-INF\classes\users.xml (系统找不到指定的路径。解决

com.exception.DaoException: java.io.FileNotFoundException: D:\Users\liuyangOS2237\Workspaces\MyEclipse%2010\Zhuce\WebRoot\WEB-INF\classes\users.xml (系统找不到指定的路径.) at com.dao.impl.UserDaoDom4jImpl.addUser(UserDaoDom4jImpl.java:84) at com.test.UserDaoDo

java.io.FileNotFoundException: [WEB-INF/spring-servlet.xml] cannot be opened because it does not exist

今天启动web 项目出现错误提示: java.io.FileNotFoundException: [WEB-INF/spring-servlet.xml] cannot be opened because it does not exist 没有找到问题原因: resource目录是存在:spring-servlet.xml 配置文件