library initialization failed - unable to allocate file descriptor table - out of memory
1.报错日志
library initialization failed - unable to allocate file descriptor table - out of memory/cm-server/aiboxCloud-web/boot/entrypoint.sh: line 2: 6 Aborted (core dumped) java -Xms1024m -Xmx2048m -jar -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:/cm-server/logs/gc-%t.log -Dfile.encoding=utf-8 -Duser.timezone=GMT+8 -XX:MaxDirectMemorySize=512m ./aiboxCloud-web.jar
2.原因:
(1) LimitNOFILE=infinity 虽然是不限制,但是在systemctl版本小于234的时候不生效,查看systemctl版本:systemctl --version
(2) docker容器的ulimit太小了,有文档说太大也不行
3.解决方法
#修改/lib/systemd/system/docker.service文件
LimitCORE=infinity
LimitNOFILE=infinity
LimitNPROC=infinity
改成
LimitCORE=65535
LimitNOFILE=65535
LimitNPROC=65535
#重启docker服务
4.参考文档
https://www.cnblogs.com/dirgo/p/16772679.html