最近在使用 wildfly 部署应用时出错,导致 wildfly 服务直接被 killed,感觉特别奇怪。代码肯定是没有问题的,但为什么放到服务器上就出错了呢。
部署时报错如下:
1 | Failed to add the deployment content to the repository: java.util.concurrent.CancellationException: Operation was cancelled |
wildfly 报错如下:
1 | ./standalone.sh: line 307: 12526 Killed |
一时还真看不出是什么毛病。
于是使用 dmesg 查找原因,终于找到了原因:
1 | # dmesg | tail |
原来是因为内存不足导致了。我使用的服务器内存只有 1G,上面跑了很多的服务,因此可以内存并不大,所以才出了问题。
参考文献:
https://issues.jboss.org/browse/JBTM-1623