I am submitting Callable objects to a ThreadPoolExecutor and they seem to be sticking around in memory.
Callable
ThreadPoolExecutor
Looking at the heap dump with the M
As a work around could you do something like:
class ClearingCallable implements Callable { Callable delegate; ClearingCallable(Callable delegate) { this.delegate = delegate; } T call() { try { return delegate.call(); } finally { delegate = null; } } }