You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2024/09/19 15:59:20 UTC

(doris) branch branch-2.1 updated: [branch-2.1][fix](jdbc catalog) Fixed FE memory leak by enabling weak references in HikariCP (#40923)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 8b1906be81f [branch-2.1][fix](jdbc catalog) Fixed FE memory leak by enabling weak references in HikariCP (#40923)
8b1906be81f is described below

commit 8b1906be81fd37ff84d2e514016f165c0484ec92
Author: zy-kkk <zh...@gmail.com>
AuthorDate: Thu Sep 19 23:59:14 2024 +0800

    [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.
---
 .../main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java
index 75432facd75..0e57f989df3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java
@@ -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());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org