我的一个过程是收到“太多打开文件”错误。使用'lsof'我看到很多(~5000)管道,例如以下样本。有没有办法找到哪个类创建了这么多管道?从我有限的理解,打开连接,流将导致创建管道。我不确定这是我的班级还是许多依赖的罐子之一。感谢。
lr-x------ 1 user general 64 2016-02-26 18:18 990 -> pipe:[427246223]
l-wx------ 1 user general 64 2016-02-26 18:18 991 -> pipe:[427246223]
lr-x------ 1 user general 64 2016-02-26 18:18 992 -> eventpoll:[427246224]
lr-x------ 1 user general 64 2016-02-26 18:18 993 -> pipe:[427246492]
l-wx------ 1 user general 64 2016-02-26 18:18 994 -> pipe:[427246492]
lr-x------ 1 user general 64 2016-02-26 18:18 995 -> eventpoll:[427246493]
lr-x------ 1 user general 64 2016-02-26 18:18 996 -> pipe:[427247239]
l-wx------ 1 user general 64 2016-02-26 18:18 997 -> pipe:[427247239]
lr-x------ 1 user general 64 2016-02-26 18:18 998 -> eventpoll:[427247240]
lr-x------ 1 user general 64 2016-02-26 18:19 999 -> pipe:[427247760]
lsof -p <pid>
java 22918 user 1409r 0000 0,10 0 427328545 unknown inode type
java 22918 user 1410r FIFO 0,6 427329412 pipe
java 22918 user 1411w FIFO 0,6 427329412 pipe
java 22918 user 1412r 0000 0,10 0 427329413 unknown inode type
java 22918 user 1413r FIFO 0,6 427329799 pipe
java 22918 user 1414w FIFO 0,6 427329799 pipe
java 22918 user 1415r 0000 0,10 0 427329800 unknown inode type
java 22918 user 1416r FIFO 0,6 427330295 pipe
java 22918 user 1417w FIFO 0,6 427330295 pipe
java 22918 user 1418r 0000 0,10 0 427330296 unknown inode type
java 22918 user 1419r FIFO 0,6 427331472 pipe
java 22918 user 1420w FIFO 0,6 427331472 pipe
java 22918 user 1421r 0000 0,10 0 427331473 unknown inode type
java 22918 user 1422r FIFO 0,6 427332784 pipe
java 22918 user 1423w FIFO 0,6 427332784 pipe
java 22918 user 1424r 0000 0,10 0 427332785 unknown inode type
java 22918 user 1425r FIFO 0,6 427333054 pipe
java 22918 user 1426w FIFO 0,6 427333054 pipe
java 22918 user 1427r 0000 0,10 0 427333055 unknown inode type
java 22918 user 1428r FIFO 0,6 427334637 pipe
java 22918 user 1429w FIFO 0,6 427334637 pipe
java 22918 user 1430r 0000 0,10 0 427334638 unknown inode type
更新: 当我尝试通过JMX连接到此进程时,下面是一个例外。该进程保持运行,但它处于挂起状态 - 没有日志滚动。
23-Feb-2016 07:22:10 sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAcceptLoop
WARNING: RMI TCP Accept-15968: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=15968] throws
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
at java.net.ServerSocket.accept(ServerSocket.java:430)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
at java.lang.Thread.run(Thread.java:662)