From 95f868f2463ed9de814cff8dbd8f0f90965d4c63 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 8 Jan 2018 10:14:33 +0100 Subject: [PATCH] Set context classloader to null in WorkQueue If threads created by the executor have a reference to the context classloader this may cause a leak. See: https://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByWebApp Bug: 517107 Change-Id: If79c1ebd3f9cf733fd88a5fce38fd46ff0d08d10 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/lib/internal/WorkQueue.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/internal/WorkQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/internal/WorkQueue.java index e3f65ae7ba..8f8aad52d7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/internal/WorkQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/internal/WorkQueue.java @@ -71,6 +71,7 @@ public class WorkQueue { public Thread newThread(Runnable taskBody) { Thread thr = baseFactory.newThread(taskBody); thr.setName("JGit-WorkQueue"); //$NON-NLS-1$ + thr.setContextClassLoader(null); thr.setDaemon(true); return thr; } -- 2.39.5