java线程内存泄漏怎么处理?


这是我打印已经挂掉的线程的堆栈信息,求各位看下帮帮忙提下建议!谢谢

   
  "Thread-11" prio=10 tid=0x00007ff8c4216800 nid=0x3aa runnable [0x00007ff8c0339000]
  
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:146)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
- locked <0x00000000c43c2610> (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:688)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1162)
- locked <0x00000000c43c2550> (a sun.net.www.protocol.http.HttpURLConnection)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2214)
at java.net.URLConnection.getContentType(URLConnection.java:502)
at com.taobao.api.internal.util.WebUtils.getResponseAsString(WebUtils.java:344)
at com.taobao.api.internal.util.WebUtils.doPost(WebUtils.java:92)
at com.taobao.api.internal.util.WebUtils.doPost(WebUtils.java:63)
at com.taobao.api.internal.util.WebUtils.doPost(WebUtils.java:43)
at com.taobao.api.DefaultTaobaoClient.doPost(DefaultTaobaoClient.java:189)
at com.taobao.api.DefaultTaobaoClient._execute(DefaultTaobaoClient.java:107)
at com.taobao.api.DefaultTaobaoClient.execute(DefaultTaobaoClient.java:83)
at com.yitaosoft.agile.top.TopClient.execute(TopClient.java:55)
at com.yitaosoft.agile.top.TopBatchClient.getFuckedCount(TopBatchClient.java:62)
at com.yitaosoft.agile.top.TopBatchClient.batchExecute(TopBatchClient.java:75)
at com.yitaosoft.agile.top.TopService.getOnSaleItems(TopService.java:135)
at com.yitaosoft.agile.util.UserRecommend.recommend(UserRecommend.java:164)
at com.yitaosoft.agile.app.TaskConsumer.run(TaskConsumer.java:44)
at java.lang.Thread.run(Thread.java:679)

Locked ownable synchronizers:
- None

java 线程安全

拉格朗余项 11 years, 1 month ago

SystemOut.log里看到什么错误? OutOfMemory?

这段Thread dump看着非常正常, 正在运行, 从socket里读数据.

Java Thread Dump可以参见:
http://www.javasanity.org/understandingthreaddumps

坏到刚刚好 answered 11 years, 1 month ago

Your Answer