views:

37

answers:

0

I seem to have a memory leak, one of the culprits seems to be the ConnectionProperty, whether it is String, Int or Boolean ones. e.g.:'com.mysql.jdbc.ConnectionPropertiesImpl$BooleanConnectionProperty', millions seem to be staying around and not being GC'd.

Here are my settings for the DB, Session Factory, Hibernate and Pooling etc..:

    <bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url"
        value="jdbc:mysql://${dbHostName}:${database.port}/${database.name}" />
    <property name="username" value="${database.username}" />
    <property name="password" value="${database.password}" />
</bean>
<bean id="txManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
</bean>
<aop:config>
            <aop:pointcut id="pcut" expression="execution(* com.package.data..*.*(..))"/>
    <aop:advisor advice-ref="txAdvice" ref="pcut" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
        <tx:method name="*" propagation="REQUIRED" />
    </tx:attributes>
</tx:advice>


<bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
            <prop key="current_session_context_class">thread</prop>
            <prop key="cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
            <prop key="hibernate.show_sql">false</prop>
            <prop key="hibernate.connection.release_mode">after_transaction</prop>

            <prop key="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop>
            <prop key="c3p0.acquire_increment">1</prop>
            <prop key="c3p0.min_size">20</prop>
            <prop key="c3p0.max_size">200</prop>
            <prop key="c3p0.timeout">300</prop>
            <prop key="c3p0.max_statements">50</prop>
            <prop key="c3p0.idle_test_period">300</prop>

            <prop key="hibernate.generate_statistics">true</prop>

        </props>
    </property>
    <property name="annotatedClasses">
        <list>
            <value>...beans...</value>
        </list>
    </property>
</bean>

The pointcut is: "execution(* com.package.data...(..))". I'd edited out any obvious names etc..

As I say, we are just getting hundreds of these on the heap that don't get collected, and I have no idea why, or where to start looking.

The App is deployed via a WAR, with the DB driver residing in Tomcats shared lib directory. We are running Tomcat6 or tcServer, but both show the same issues.

Any Ideas?