1

我正在使用 Intellij 探查器(异步探查器)在 Spring Boot Java 应用程序中运行测试。我使用分析器来调查测试暴露的可能的内存泄漏。

当我分析转储(图像取自 Eclipse MAT)时,我看到大部分内存被以下人员占用:

org.gradle.internal.remote.internal.hub.OutgoingQueue 类。

对象的类型为 org.gradle.internal.remote.internal.hub.protocol.ChannelMessage

问题是这个类是什么,为什么它会占用这么多内存?

测试本身并没有什么特别之处:

  @Test
  @Timeout(value = 180)
  @SqlGroup({
      @Sql(scripts = {
          "classpath:somePathToScript.sql"},
          executionPhase = BEFORE_TEST_METHOD),
      @Sql(scripts = {
          "classpath:classpath:pathToScript.sql"},
          executionPhase = AFTER_TEST_METHOD)
  })
  public void test(){
List<String> accounts  = repository.findAccountsBy....
for (String account: accounts) {
     callApplicationLogic(account)
}
}

顶级消费者

在此处输入图像描述

4

1 回答 1

1

事实证明,测试调用了一个功能,导致在短时间内打印大量日志。(SL4J) 删除后,内存运行正常 不确定原因,但这是解决方案。

于 2022-01-18T14:53:27.810 回答