Skip to content

[Bug] FE memory leak #45609

@cambyzju

Description

@cambyzju

Search before asking

  • I had searched in the issues and found no similar issues.

Version

branch-2.1

What's Wrong?

fe memory leak

What You Expected?

do not leak

How to Reproduce?

One Reproduce Steps:
1、create a jdbc catalog:

CREATE CATALOG `test_catalog` PROPERTIES (
"user" = "test_user",
"type" = "jdbc",
"password" = "xxxx",
"metadata_refresh_interval_sec" = "10",
"jdbc_url" = "jdbc:mysql://127.0.0.1:3600/cambyzhu?yearIsDateType=false&tinyInt1isBit=false&transformedBitIsBoolean=true&useUnicode=true&characterEncoding=utf-8",
"driver_url" = "mysql-connector-j-8.0.33.jar",
"driver_class" = "com.mysql.cj.jdbc.Driver",
"checksum" = "801b67e18f23e4e9ec392812a1c108d4"
);

2、then drop user test_user

3、Trigger the memory leak:

for i in {1..10000};do mysql -h127.0.0.1 -uroot -P9030 -e "switch test_catalog;show databases";echo $i;done

We will got error message like:
ERROR 1105 (HY000) at line 1: Failed to initialize JdbcMySQLClient: Catalog test_catalog can not connect to jdbc due to error: Access denied for user 'default_cluster:test_user@127.0.0.1' (using password: YES)

Then we found:
1、jvm_non_heap leak
2、java.net.FactoryURLClassLoader leak in jvm heap
Clipboard_Screenshot_1734524983

Another Reproduce Steps:
1、create a jdbc catalog with metadata_refresh_interval_sec = 1
2、Trigger the memory leak:

for i in {1..10000};do mysql -h127.0.0.1 -uroot -P9030 -e "show databases from test_catalog;";echo $i;sleep 1;done

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions