Search code examples
javalinuxsocketslog4jrmi

Standalone Java App dies after a few days


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,


Solution

  • 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

    kill -3 <pid>
    

    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.