Community
Participate
Working Groups
despite an attempt here https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java#L58 JGit-AlarmQueue still keeps the application classloader pinned via * Thread.inheritedAccessControlContext * Thread.inheritableThreadLocals * Thread.contextClassLoader my current workaround is explicit "stop" before application unload, this does release the class loader: public static void stop() throws Exception { try { final Field field = BatchingProgressMonitor.class .getDeclaredField("alarmQueue"); field.setAccessible(true); final ScheduledThreadPoolExecutor alarmQueue = (ScheduledThreadPoolExecutor) field .get(null); alarmQueue.shutdownNow(); } catch (final Throwable e) { logger.error("Failed to stop.", e); } } a better solution? I would rather have a public Git.shutdown() to release all threads, NLS, etc. rather the trying to outsmart the vm/classloader gc logic
Definitely in favor of a shutdown method. See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=449321, https://bugs.eclipse.org/bugs/show_bug.cgi?id=517107