Closed maxxedev closed 8 months ago
In rare cases, ThreadPerTaskExecutor may cause memory leak. Improve clean up of threads
Make a change so that the code looks like this, before: https://github.com/thunkware/virtual-threads-backport/blob/f4b41439f45e7afa988c2b2aede2dfd71636a2f0/src/main/java/com/github/thunkware/ThreadProvider8.java#L78-L81
and after:
Thread thread = threadFactory.newThread(() -> { + try { + command.run(); + } finally { + threads.remove(Thread.currentThread()); + } });
In rare cases, ThreadPerTaskExecutor may cause memory leak. Improve clean up of threads
Make a change so that the code looks like this, before: https://github.com/thunkware/virtual-threads-backport/blob/f4b41439f45e7afa988c2b2aede2dfd71636a2f0/src/main/java/com/github/thunkware/ThreadProvider8.java#L78-L81
and after: