MySQL JDBC中的内存泄漏

发布于 2025-02-13 04:35:47 字数 1250 浏览 0 评论 0原文

我正在使用MySQL连接器最新版本的Springboot Java应用程序: 8.0.26 ('MySQL-Connector-Java')。

更具体地说,它发生在com.mysql.cj.jdbc.abandonedconnectioncleanupthread.connection-finalizerfinalizerphantomrefs对象中。

我尝试了一些论坛中已经提到的多种方法( stackoverflow”> stackoverflow ,mysql社区等)就像手动清洁放弃ConnectionCleanUpthread线程一样,但根本没有任何作用。

以下是我的实现,在此链接

public static void closeAbandonedConnectionCleanupThread() {
    try {
        AbandonedConnectionCleanupThread.checkedShutdown();
    } catch (Exception e) {
        log.error("Exception while cleaning up MySql thread: " + e.getMessage());
    }
}

以下是堆积分析,用于参考,

任何帮助都将不胜感激。

I'm using springBoot Java application with MySql connector latest version: 8.0.26 ('mysql-connector-java').

More specifically it's happening in com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.connectionFinalizerPhantomRefs object.

I tried multiple approaches which is already mentioned in some forums (stackoverflow, mySql community etc) like manually cleaning up the AbandonedConnectionCleanupThread thread but nothing works at all.

Below is my implementation, mentioned in this link:

public static void closeAbandonedConnectionCleanupThread() {
    try {
        AbandonedConnectionCleanupThread.checkedShutdown();
    } catch (Exception e) {
        log.error("Exception while cleaning up MySql thread: " + e.getMessage());
    }
}

Below is the heap-dump analysis for reference,

enter image description here

Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文