Describe the bug Due to a memory leak of DefaultLongTaskTimer$SampleImpl instances i debugged into the code starting and stopping the LongTaskTimer.

My application apparently has 3 handlers set up

Image

Each of those creates a LongTaskTimer.Sample and stores it in the same context instance under LongTaskTimer.Sample.class overriding any previous entry

Image

On observation stopped only the sample in the context is beeing stopped and removed (3 times) from the activeTasks Deque

Image

Subsequent stops try to remove the already stopped sample

Image

To Reproduce If necessary i will try to extract a minimal sample from the application.

Expected behavior Create a only single LongTaskTimer on observation start or stop all created instances.

I hope this helps.

Kind regards, Tom

Comment From: kloni

Ah, sorry. This is the wrong project.