gpt4 book ai didi

tomcat - Icefaces 打开 jsf 和 icefaces jar 文件数百次

转载 作者:行者123 更新时间:2023-11-28 23:49:39 26 4
gpt4 key购买 nike

我只是让我系统的所有用户同时尝试登录。我的服务器因这个错误而瘫痪:

SEVERE: Socket accept failed
Throwable occurred: java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:449)
at java.net.ServerSocket.implAccept(ServerSocket.java:473)
at java.net.ServerSocket.accept(ServerSocket.java:441)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:59)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:212)
at java.lang.Thread.run(Thread.java:736)
May 9, 2012 10:04:11 AM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run

我运行了一个 lsof 命令来查看 tomcat 用户打开了哪些文件,并得到了一个巨大的文件列表。大多数看起来很正常,但后来我遇到了大约 700 个相同文件的条目,这是该输出的片段:

java    12285 tomcat  256r   REG                8,3  1470076    1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 257r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 258r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 259r REG 8,3 271669 1040879 /usr/share/tomcat7/shared/nmsc/icefaces-3.0.0.RC2.jar
java 12285 tomcat 260r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 261r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 262r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 263r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 264r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 265r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 266r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 267r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 268r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 269r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 270r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 271r REG 8,3 271669 1040879 /usr/share/tomcat7/shared/nmsc/icefaces-3.0.0.RC2.jar
java 12285 tomcat 272r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 273r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 274r REG 8,3 271669 1040879 /usr/share/tomcat7/shared/nmsc/icefaces-3.0.0.RC2.jar
java 12285 tomcat 275r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 276r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 277r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 278r REG 8,3 271669 1040879 /usr/share/tomcat7/shared/nmsc/icefaces-3.0.0.RC2.jar
java 12285 tomcat 279r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 280r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 281r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar
java 12285 tomcat 282r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 283r REG 8,3 271669 1040879 /usr/share/tomcat7/shared/nmsc/icefaces-3.0.0.RC2.jar
java 12285 tomcat 284r REG 8,3 1470076 1040880 /usr/share/tomcat7/shared/nmsc/icefaces-ace-3.0.0.RC2.jar
java 12285 tomcat 285r REG 8,3 1955103 1040820 /usr/share/tomcat7/shared/nmsc/jsf-impl-2.1.4.jar

我为 tomcat 用户增加了允许的文件句柄数量,让我度过了一个上午,但为什么 tomcat 会为每个 HTTP 请求打开一个新的 icefaces 和 jsf 副本(这似乎是正在发生的事情)而不是使用类加载器在启动时加载的文件副本?我什至不知道从哪里开始解决这个问题。

最佳答案

就个人而言,我会从分析器开始(我使用 YourKit,因为他们为开源开发人员提供免费副本),获取内存快照,然后搜索这些文件名。这应该会导致文件、URL 或类似的对象,它们有望提供一些关于问题所在的线索。如果没有,您将需要开始跟踪对象分配,这要昂贵得多但可行。其他分析器可用;)

关于tomcat - Icefaces 打开 jsf 和 icefaces jar 文件数百次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10519880/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com