I have a Java webapp running on Tomcat, with Hibernate and C3P0. All entity classes and JPA Controllers were done with Netbeans wizzard. There is a servlet that when called inserts many objects in the database (using the JPA controllers).
The problem is that looking at my webapp with Java VisualVM I found that there are a lot of Timers and com.mchange.v2.async.ThreadPoolAsynchronousRunner classes, and it grows as time pass. For every Timer there are 3 Threads created.
All the Threads and Timers are in WAIT state, and I think that this problem may be behind an OutOfMemory error (Java Heap Space) that the app. produces. And even though I see at MySQL Administrator that all the connections are closed when the servlet ends the task, may be some objects are still in memory.
Is it normal that C3P0 creates leaves more than 700 Timeras and 2100 Threads in "WAIT" state?
Thanks
Ezequiel