I have a Java webapp running on Tomcat with Hibernate and C3P0. All entity classes and JPA controllers were run using NetBeans wizzard. There is a servlet that, when called, inserts many objects into the database (using JPA controllers).
The problem is that looking at my webapp with Java VisualVM, I found that there are many Timers and com.mchange.v2.async.ThreadPoolAsynchronousRunner classes, and it grows over time. For each timer, 3 threads are created.
All threads and timers are in WAIT state, and I think that this problem may be due to the OutOfMemory (Java Heap Space) error that the application has. produces. And although I see with the MySQL administrator that all connections are closed when the servlet completes the task, there may be some objects still in memory.
Is it normal for C3P0 to produce more than 700 leaves and 2,100 threads in the WAIT state?
thanks
Ezekuel
source share