mosh
mosh

Reputation: 534

Java heap dump - why so much memory is taken by Gradle

I am running a test, in a Spring boot Java application, using Intellij profiler (Async profiler). I use the profiler to investigate a possible memory leak, which the test exposes.

When i analyze the dump (images are taken from Eclipse MAT) i see that the majority of the memory is taken by:

org.gradle.internal.remote.internal.hub.OutgoingQueue class.

The objects are of type org.gradle.internal.remote.internal.hub.protocol.ChannelMessage

The question is what is this class and why does it occupy so much of the memory?

The test itself is nothing special:

  @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)
}
}

Top consumers

enter image description here

Upvotes: 1

Views: 853

Answers (1)

mosh
mosh

Reputation: 534

Turns out the test has invoked a functionality that caused a lot of logs to be printed in a short interval. (SL4J) Once removed, the memory behaved O.K. Not sure about the reason, but that was the solution.

Upvotes: 1

Related Questions