有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java内存泄漏。mysql。jdbc。ConnectionPropertiesImpl$*任意*ConnectionProperty

我似乎有内存泄漏,罪魁祸首之一似乎是ConnectionProperty,无论它是String、Int还是Boolean。e、 g.:com.mysql.jdbc.ConnectionPropertiesImpl$BooleanConnectionProperty,数百万人似乎呆在家里,而不是在家里

以下是我对数据库、会话工厂、休眠和池等的设置:

<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>

切入点是:“执行(*com.package.data..(..)”。我删掉了任何明显的名字等等

正如我所说,我们只是在堆上收集了数百个没有收集到的,我不知道为什么,也不知道从哪里开始寻找

该应用程序通过WAR部署,DB驱动程序驻留在Tomcats共享库目录中。我们正在运行Tomcat6或tcServer,但它们都显示了相同的问题

有什么想法吗


共 (1) 个答案

  1. # 1 楼答案

    试试这两个:

    1. 将连接池最小/最大大小设置为0或1。它还在生长吗
    2. 根据您的探查器工具,尝试跟踪从对象到其GC根的路径