Apparent memory leak
Status: Beta
Brought to you by:
swaldman
Our application crashes with OutOfMemoryError every 2-3 hours.Profiling information says that 4GB of memory is filled with TDSPacket objects (we are using SQLServer v3 driver), which are referenced by TDSReader owned by "Timer-Thread-3". My take on it is c3p0's helper threads have a memory leak. We already turned off statement caching, but still getting OOME.
Current configuration attached.
Hibernate configuration
Hi,
c3p0's TimerTasks offer transient methods; if somehow they are responsible for your OOME then those methods must still be somehow stuck executing. can you get a Thread dump from your JVM and see what "Timer-Thread-3" is up to just prior or after to your OOMEs? That would help track things down.
c3p0 only uses a single Timer. It sounds like your application uses several, so other libraries may be in play. c3p0's helper threads (of which there are a configurable number) have names like "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0"
Please let me know if you get a Thread dump showing c3p0-related code in the stack trace of the errant Timer Thread!
smiles,
Steve