Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
see PR
in 3.x branch, org.mariadb.jdbc.Driver registers itself in java.sql.DriverManager from a static initializer:
static { |
DriverManager.registerDriver(new Driver()); |
}
|
DriverManager keeps a strong reference to every registered driver for the lifetime of the JVM (until deregisterDriver() is explicitly called). That reference keeps the driver's Class alive, and when the driver class was loaded by an application's own class loader rather than a shared one keeps that entire class loader from being garbage collected once the application is redeployed or undeployed.
Impact: any application using MariaDbDataSource or the built-in pool inside a container that supports hot redeploy accumulates one pinned class loader per redeploy.