Details
-
Bug
-
Status: Open
-
Not a Priority
-
Resolution: Unresolved
-
1.12.0, 1.13.0
-
None
Description
DriverManager keeps registered drivers in its internal data structures which prevents they from gc after task finished. I confirm it in standalone session cluster by observing that ChildFirstClassLoader could not be reclaimed after several GC.run, it should exist in all session clusters.
Tomcat documents this and fixes/circumvents this with JdbcLeakPrevention.
Should we solve this in runtime ? Or treat it as connector and clients' responsibility to solve it using RuntimeContext.registerUserCodeClassLoaderReleaseHookIfAbsent or similar ?
Personally, it would be nice to solve in runtime as a catch-all to avoid memory-leaking and provide consistent behavior to clients cross per-job and session mode.