[英]Java heap dump - why so much memory is taken by Gradle
我正在使用 Intellij 分析器(異步分析器)在 Spring 啟動 Java 應用程序中運行測試。 我使用分析器來調查可能的 memory 泄漏,測試會暴露出來。
當我分析轉儲時(圖像取自 Eclipse MAT),我看到 memory 的大部分由以下人員拍攝:
org.gradle.internal.remote.internal.hub.OutgoingQueue class。
對象的類型為 org.gradle.internal.remote.internal.hub.protocol.ChannelMessage
問題是這個 class 是什么,為什么它占據了 memory 這么多?
測試本身並沒有什么特別之處:
@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)
}
}
事實證明,測試調用了一個功能,導致在短時間內打印大量日志。 (SL4J) 移除后,memory 表現正常 不確定原因,但這是解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.