独立 Java 应用程序几天后就死掉了
我们有一个 Java 应用程序,它通过 RMI 连接到另一个 Java 应用程序。 该应用程序有多个实例同时运行,几天后,一个实例停止处理...CPU 为 0,我有一个额外的线程正在侦听特定端口,这有助于关闭该应用程序。
我可以连接到特定端口,但应用程序不执行任何操作。
我们使用 Log4j 来保存日志,并且没有写入任何内容,因此不会引发任何异常。
我们还使用 c3p0 进行数据库连接。
有人有想法吗?
谢谢,
We have a Java App that connects via RMI to another Java app.
There are multiple instances of this app running at the same time, and after a few days an instance just stops processing... the CPU is in 0 and I have an extra thread listening to an specific port that helps to shutdown the App.
I can connect to the specific port but the app doesn't do anything.
We're using Log4j to keep a log and nothing is written, so there aren't any exceptions thrown.
We also use c3p0 for the DB connections.
Anyone have ideas?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议从受影响应用程序的线程转储开始。
您需要逐个线程查看正在发生的情况。可能是您有一个长时间运行的线程,或者其他进程正在阻止其他工作的完成。
由于您运行的是 Linux,因此可以使用以下命令获取线程转储。
如果您需要帮助阅读输出,请将其发布在您原来的问题中。
如果线程转储中没有显示任何内容,则可以查看其他替代方案。
I would suggest starting with a thread dump of the affected application.
You need to see what is going on on a thread by thread basis. It could be that you have a long running thread, or other process which is blocking other work from being done.
Since you are running linux, you can get your thread dump with the following command
If you need help reading the output, please post it in your original question.
If nothing is shown from the thread dump, other alternatives can be looked at.
嗯...我建议使用 JMetter 来强调应用程序并记下任何可能出现的奇怪情况发生(例如内存泄漏、死锁等)。还要检查代码中是否有任何可能中断程序(或 System.exit() 调用)的异常。最后,如果其他人可以访问计算机,则检查该进程是否没有以某种方式手动终止是有意义的。
Hum... I would suggest using JMetter to stress the Application and take note of anything weird that might be happening (such as Memory Leaks, Deadlocks and such). Also review the code for any Exceptions that might interrupt the program (or System.exit() calls). Finally, if other people have access to the computer, makes sense to check if the process wasn't killed manually somehow.