如何解决内存泄漏问题

Kuma_ 发布于 2016/04/30 16:31
阅读 2K+
收藏 0

@wenshao 你好,想跟你请教个问题:

IDE开发部署项目的时候配置有问题,修改后热部署报以下警告,并且上一次部署时获取连接的线程还在继续,一直都是获取连接错误。

20-Apr-2016 22:54:25.958 WARNING [http-apr-8181-exec-21] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [springmvc] appears to have started a thread named [Druid-ConnectionPool-Create-242721800] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:java.lang.Thread.sleep(Native Method)com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1990) 20-Apr-2016 22:54:25.959 WARNING [http-apr-8181-exec-21] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [springmvc] appears to have started a thread named [Druid-ConnectionPool-Destroy-242721800] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:java.lang.Thread.sleep(Native Method)com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2032)

顺便提个小BUG:

prop:
name=test
url=jdbc:mysql://localhost:3306/test 
username=root
password=123456

DruidDataSource dataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(prop);

通过DruidDataSourceFactory.createDataSource创建的DruidDataSource,在DruidStatView name属性是不生效的

加载中
0
tinshen
tinshen
热部署,会出现很多莫名其妙的问题。 还有可能出现内存溢出等。 为了避免跳进奇怪的坑里。 请重启应用容器。
0
yak
yak

Have You Tried Turning It Off And On Again

  from  IT Crowd

0
qinjian379
qinjian379

引用来自“yak”的评论

Have You Tried Turning It Off And On Again

  from  IT Crowd

i dong te nao wang te you san d.
返回顶部
顶部