kamon-io / kanela

The Kamon Instrumentation Agent
Apache License 2.0
66 stars 22 forks source link

Byte-buddy memory leak #145

Open insdami opened 1 year ago

insdami commented 1 year ago

Hi, we are experiencing a memory leak which according to the latest dump comes from Kanela (byte buddy).

We are using Kanela:

val agent = "io.kamon"           % "kanela-agent"     % "1.0.16"

via native packager

addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.6")

javaAgents += Kamon.agent

along with Kamon "2.5.11".

The application is an akka-http with gRPC one which is intialised as explained in guide

Screenshot 2022-11-29 at 14 03 47 Screenshot 2022-11-29 at 14 03 34

Do you know what could be happening that the hashmap keeps growing over time? Let me know if I can provide more details to understand the problem better.

ivantopo commented 1 year ago

Hey @insdami, do you have any info about how big does it get over time?

I remember looking into this a long time ago and realizing that even though the type pool is "big" (I have seen it take up to 50mb), it was always contained. That would make this more of a (relatively) high memory usage problem rather than a memory leak. Have you seen it go completely out of control?