[branch-2.1][fix](jdbc catalog) Fixed FE memory leak by enabling weak references in HikariCP (#40923)
pick (#40773) When FE collects statistics, its ThreadLocal will hold the ThreadLocal of HikariCP in JdbcClient, making it difficult for HikariCP to be gc, so this problem can be alleviated by enabling weak references of HikariCP.
This commit is contained in:
@ -97,6 +97,7 @@ public abstract class JdbcClient {
|
||||
}
|
||||
|
||||
protected JdbcClient(JdbcClientConfig jdbcClientConfig) {
|
||||
System.setProperty("com.zaxxer.hikari.useWeakReferences", "true");
|
||||
this.catalogName = jdbcClientConfig.getCatalog();
|
||||
this.jdbcUser = jdbcClientConfig.getUser();
|
||||
this.isOnlySpecifiedDatabase = Boolean.parseBoolean(jdbcClientConfig.getOnlySpecifiedDatabase());
|
||||
|
||||
Reference in New Issue
Block a user