提交 a577179a 编写于 作者: C chegar

7008595: Class loader leak caused by keepAliveTimer thread in KeepAliveCache

Reviewed-by: michaelm
上级 33a455f7
......@@ -106,6 +106,9 @@ public class KeepAliveCache
keepAliveTimer = new Thread(grp, cache, "Keep-Alive-Timer");
keepAliveTimer.setDaemon(true);
keepAliveTimer.setPriority(Thread.MAX_PRIORITY - 2);
// Set the context class loader to null in order to avoid
// keeping a strong reference to an application classloader.
keepAliveTimer.setContextClassLoader(null);
keepAliveTimer.start();
return null;
}
......
......@@ -185,6 +185,9 @@ class KeepAliveStream extends MeteredStream implements Hurryable {
cleanerThread = new Thread(grp, queue, "Keep-Alive-SocketCleaner");
cleanerThread.setDaemon(true);
cleanerThread.setPriority(Thread.MAX_PRIORITY - 2);
// Set the context class loader to null in order to avoid
// keeping a strong reference to an application classloader.
cleanerThread.setContextClassLoader(null);
cleanerThread.start();
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册