Reputation: 95
This problem happens when my web application runs between 40 minutes to an hour and my application web doesn't work, the browser wait a response from server, i dont know if it is not by any error in the programming that i doing or a bug in tomcat or bug in jvm.
and this is the exception:
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]"
Upvotes: 1
Views: 1758
Reputation: 14149
It's very probably that you have a memory leak in your application. You have to investigate which objects are eating you memory. To do this, you have to:
Then you will see where the problem is. It will also be very helpful if you will check your memory settings? Maybe your application just needs more memory?
Upvotes: 3
Reputation: 9872
This is not a trivial problem, the best way to fight it is to try some post-mortem analysis of your object pool after the problem rises again. I would use jconsole (it is for free and included in every modern JDK), and there are other tools.
Once you have that analysis, there are 2 options:
How can I increase the JVM memory?
Upvotes: 0
Reputation: 51
Since you say that it appears after a long time (over 40 mins) it is likely to be caused by memory leaks (you probably continuously take memory for objects and keep it in use so that the garbage collector can do nothing about it).
Upvotes: 0
Reputation: 118601
It's extremely likely to be your code. Tomcat and the JVM don't go OOM on their own nowadays. You are either leaking memory, or simply your app requires too much memory for your current configuration.
Upvotes: 1