Hi there,
I want to share a weird example. On production our application is throwing OOM exception, we took a heap dump and started to analyze that later we found problem with com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache instance. The size of this object is about 50% of heap size. The application is running with billions of users and server goes down again and again.
This application is running on tomcat, where the tomcat connector allows 300 max concurrent requests and following are the c3p0 configurations.
jdbc.hibernate.c3p0.minPoolSize=2 jdbc.hibernate.c3p0.maxPoolSize=150 jdbc.hibernate.c3p0.maxIdleTime=0 jdbc.hibernate.c3p0.maxStatementsPerConnection=50 jdbc.hibernate.c3p0.numHelperThreads=6
From heap monitoring tool we are getting the following message
One instance of "com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache" loaded by "org.apache.catalina.loader.WebappClassLoader @ 0x82f1c58" occupies 72 970 824 (57,75%) bytes. The memory is accumulated in one instance of "com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache" loaded by "org.apache.catalina.loader.WebappClassLoader @ 0x82f1c58"
Please advise:- What can be reason this instance taking such huge memory? Are we running with right c3p0 configuration? What are the recommended configurations for a heavy loaded application?
Thanks in advance
|