zoukankan      html  css  js  c++  java
  • but has failed to stop it. This is very likely to create a memory leak(c3p0在Spring管理中,连接未关闭导致的内存溢出)

    以下是错误日志信息:

    严重: The web application [/news] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
    严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-AdminTaskTimer] but has failed to stop it. This is very likely to create a memory leak.
    2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
    严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-HelperThread-#0] but has failed to stop it. This is very likely to create a memory leak.
    2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
    严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-HelperThread-#1] but has failed to stop it. This is very likely to create a memory leak.
    2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
    严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-HelperThread-#2] but has failed to stop it. This is very likely to create a memory leak.


    堆栈信息:

    Exception in thread "C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-AdminTaskTimer" java.lang.NullPointerException
        at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:293)
        at com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:729)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)



    我的情况是在配置数据源时未配置销毁dataSource对象时执行close方法关闭连接

    	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" >
    		<property name="driverClass" value="${driverClass}"></property>
    		<property name="jdbcUrl" value="${jdbcUrl}"></property>
    		<property name="user" value="${user}"></property>
    		<property name="password" value="${password}"></property>
    
    		<property name="initialPoolSize" value="1"></property>
    		<property name="minPoolSize" value="1"></property>
    		<property name="maxPoolSize" value="20"></property>
    		<property name="maxIdleTime" value="60"></property>
    	</bean>

    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" > 在这里面加入destroy-method="close"

  • 相关阅读:
    C#使用spire.doc对word文档表格进行数据填充(主要针对word插入图像)
    FPGA学习——Xilinx Vivado 实现led流水灯详解
    Xilinx ZYNQ 7000+Vivado2015.2系列(四)之GPIO的三种方式:MIO、EMIO、AXI_GPIO
    清《己亥杂诗》
    FPGA编程语言VHDL OR Verilog
    tar解压包的时候出现错误 gzip: stdin: not in gzip format
    String和List相互转换
    vue:自定义验证form表单中的数组
    qt 数据库连接配置 qt oracle驱动自行编译配置
    不安装oracle client 客户端 Qt连接oracle qocidriver
  • 原文地址:https://www.cnblogs.com/37sky/p/5055551.html
Copyright © 2011-2022 走看看