You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(very) surprisingly, a static thread pool executor will prevent the
JVM from ever properly shutting down, because of a circular nature
of the references. Static variables and thread objects are GC roots,
and the thread pool object references its child threads while the
threads themselves reference the threadpool. No amount of GC runs
will make anything unreachable, so the JVM can't finalize and
shut down. To break the cycle, we need to forcibly shutdown the
thread pool, which causes it to kill its threads and allows the GC
to unravel the references.
see also: https://stackoverflow.com/a/10395700
0 commit comments