今天在调程序的过程中出现了一个open too many files Exception,这个异常异常陌生,于是乎借助强大的搜索引擎,找到了解决的办法。
注意:可以举一反三的
1. ulimit -a 查看系统目前资源限制的设定。
[root@test security]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
通过以上命令,我们可以看到open files 的最大数为1024
那么我们可以通过以下命令修改该参数的最大值(其他参数值也可仿照着修改)
2. ulimit -n 4096
[root@test security]# ulimit -n 4096
[root@test security]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
这样我们就修改了系统在同一时间打开文件资源的最大数,基本解决以上问题。
分享到:
相关推荐
While it has been tested and has even been used in at least two production applications for several months now prior to initial release, there are so many combinations of property settings, ...
C++ is the main development language used by many of Google's open-source projects. As every C++ programmer knows, the language has many powerful features, but this power brings with it complexity, ...
14. 文件打开过多导致的“too many open files”错误,需要管理文件句柄。 15. 数据增强过程中遇到“TypeError: Invalid with type”错误,检查相关操作是否正确。 16. MindRecord文件无法成功打开,检查文件的完整...
Jet Airliner, Don't Take Me Too Far Away Creating Data Sources System Data Sources Programmatically Creating Data Sources Other Interesting Settings Your Environment Data Definition Language ...
Disassembler: Several disassembler instructions had a comma too many or too few ,fixed those Disassembler: Fixed the description for ret # Disassembler/Debug: Fixed the address that is being edited ...
7)....Added: Streaming unpacked debug info into temporal files instead of memory - this greatly reduces run-time application memory usage at cost of slightly slower exception processing. This also ...
t repaint when Enabled changed.5.00 of 5 Closed2625 Impossible to open a .TLB into the TLB Editor if missing uses reference3.50 of 5 Closed2608 Compiler crashes, dcc70.dll Read of address 000000004.00...
)).0.9.3b- Many changes, I added a SakMsg component that make send binary attachments a snap. But have one problem, if you send as attach a file > 20 Kb, it doesn‘t work (I don‘t know why, maybe a ...
+ the common dialogs (file open/save, print) did not accept keystokes until after they were clicked with the mouse, which makes it terribly hard for non-mouse users. Fixed. + If the current path ...
+ exception 'Unregistered classtype encountered in nodename' instead of general exception (NativeXmlObjectStorage) ! Local bias (daylightsaving) and time zone designator in date/time conversion ...
- fixed bug with URLs in Open Document Text and Open Document Spreadsheet exports - fixed format string in XLS OLE export - fixed format string in XLS BIFF8 export - fixed output of the check boxes ...
VclSkin automatically skin kinds of windows in application, include Delphi forms,MDIform and common Windows dialogs (MsgBox,Open/Save,Font,Print), even the Exception MsgBox. Vclskin not only support ...
安装linux工具源码 (UUI) Universal USB ...This Open Source tool falls under the GNU General Public License Version 2 Source Code is made available at time of download, from the official UUI page: ...
downloading and unbundling pop31_1_1.zip, add pop3.jar to your CLASSPATH, too. After installing JavaMail 1.1.3, install the JavaBeans Activation Framework. Installing the JavaBeans Activation ...
Contents Module Overview 1 Lesson 1: Memory 3 Lesson 2: I/O 73 Lesson 3: CPU 111 Module 3: Troubleshooting Server Performance ...Troubleshooting server performance-based support calls requires ...
oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 第一章 Oracle入门 一、 数据库概述 数据库(Database)是按照数据结构来组织、存储和管理数据的仓库,它产生于距今五十年前。...