[ https://issues.apache.org/jira/browse/KAFKA-16059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17801127#comment-17801127 ]
Divij Vaidya commented on KAFKA-16059: -------------------------------------- Hey [~goyarpit] I am using intellij profiler and it's quite simple to use, no additional setup required. First, we will ensure that tests are executed using a single thread. You can specify it using the build parameter maxParallelForks, i.e. you execute the command `./gradlew -PmaxParallelForks=1 -PmaxScalacThreads=1 :core:test` Now, since the tests are executing, you can attach your favourite profiler to it. I am using Intellij profiler, where you select the process you want to attach the profiler to, right click and then click on "CPU and Memory live charts". You can also take a heap dump and a thread dump using this interface. !Screenshot 2023-12-29 at 11.13.01.png! > Fix leak of ExpirationReaper-1-AlterAcls threads in :core:test > -------------------------------------------------------------- > > Key: KAFKA-16059 > URL: https://issues.apache.org/jira/browse/KAFKA-16059 > Project: Kafka > Issue Type: Sub-task > Reporter: Divij Vaidya > Assignee: Arpit Goyal > Priority: Major > Attachments: Screenshot 2023-12-29 at 11.13.01.png > > > We are leaking hundreds of ExpirationReaper-1-AlterAcls threads in one of the > tests in :core:test > {code:java} > "ExpirationReaper-1-AlterAcls" prio=0 tid=0x0 nid=0x0 waiting on condition > java.lang.Thread.State: TIMED_WAITING > on > java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@3688fc67 > at java.base@17.0.9/jdk.internal.misc.Unsafe.park(Native Method) > at > java.base@17.0.9/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252) > at > java.base@17.0.9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672) > at > java.base@17.0.9/java.util.concurrent.DelayQueue.poll(DelayQueue.java:265) > at > app//org.apache.kafka.server.util.timer.SystemTimer.advanceClock(SystemTimer.java:87) > at > app//kafka.server.DelayedOperationPurgatory.advanceClock(DelayedOperation.scala:418) > at > app//kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper.doWork(DelayedOperation.scala:444) > at > app//org.apache.kafka.server.util.ShutdownableThread.run(ShutdownableThread.java:131) > {code} > The objective of this Jira is to identify the test and fix this leak -- This message was sent by Atlassian Jira (v8.20.10#820010)