gpt4 book ai didi

java.net.BindException : Cannot assign requested address, java.io.IOException:打开的文件太多

转载 作者:行者123 更新时间:2023-12-02 12:18:19 25 4
gpt4 key购买 nike

我收到异常 java.net.BindException: 无法分配请求的地址,如果发生此异常,我会尝试使用相同的端口和主机再次绑定(bind)它。但经过一些绑定(bind)尝试后,我收到了 java.io.IOException: Too much open files.

堆栈跟踪:

    java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.SctpServerChannelImpl.bind(SctpServerChannelImpl.java:109)
at com.sun.nio.sctp.SctpServerChannel.bind(SctpServerChannel.java:184).

在一些失败之后:

    java.io.IOException: Too many open files
at sun.nio.ch.IOUtil.makePipe(Native Method)
at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:65)
at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:36)
at java.nio.channels.Selector.open(Selector.java:227)

当java.net.BindException:无法分配请求的地址时,FD是否可能保持打开状态?

最佳答案

这通常是操作系统级别的问题。考虑增加可以打开的文件数量。在 Linux 上,设置位于/etc/security/limits.conf 中:

UID 软文件 4096UID硬编码10240

关于java.net.BindException : Cannot assign requested address, java.io.IOException:打开的文件太多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31688529/

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