【发布时间】:2020-04-06 02:35:42
【问题描述】:
我的网络应用程序似乎内存不足,我认为这是由于线程泄漏。似乎线程被卡在等待中,并且越来越大,直到内存达到堆大小的顶部。在空闲且不使用 Web 应用程序时,我的本地 Tomcat 服务器上的 Web 应用程序的线程大小会增加。我对线程泄漏不是很了解,但我确信线程应该被释放以释放分配的内存。
我已经进行了线程转储,其中很多线程正在 com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread 上等待,如下所示。
"Thread-124" - Thread t@378
java.lang.Thread.State: TIMED_WAITING
at java.lang.Object.wait(Native Method)
- waiting on <44c53e01> (a com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread)
at com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread.run(SyncIdleConnectionMonitorThread.java:22)
Locked ownable synchronizers:
- None
"Thread-122" - Thread t@371
java.lang.Thread.State: TIMED_WAITING
at java.lang.Object.wait(Native Method)
- waiting on <3212c7ae> (a com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread)
at com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread.run(SyncIdleConnectionMonitorThread.java:22)
Locked ownable synchronizers:
- None
任何解决此问题的有用提示将不胜感激。
【问题讨论】:
标签: java multithreading unirest