dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

dd-java-agent 1.48.2 uses ~100-200MiB more memory

Open sy-lee opened this issue 7 months ago • 6 comments

Tracer Version(s)

1.48.2

Java Version(s)

17.0.13, 21.0.7

JVM Vendor

Eclipse Adoptium / Temurin

Bug Report

JVM processes launched with dd-java-agent 1.48.2 uses significantly more memory (~100-200MiB) than 1.48.1.

Interestingly we did not encounter the file descriptor leak issue in 1.48.1, and have observed open FDs to be mostly stable.

Expected Behavior

Memory footprint should stay mostly the same for a patch upgrade.

Reproduction Code

No response

sy-lee avatar May 08 '25 05:05 sy-lee

@sy-lee do you have profiling enabled? 1.48.2 included a new version of the profiling library

mcculls avatar May 08 '25 07:05 mcculls

Yes we have profiling enabled. Is this expected with the new version?

sy-lee avatar May 08 '25 08:05 sy-lee

these are all the enabled features:

-Ddd.trace.analytics.enabled=true
-Ddd.integration.jdbc-datasource.enabled=true
-Ddd.http.server.route-based-naming=false
-Ddd.trace.client-ip.enabled=true
-Ddd.integration.kotlin_coroutine.experimental.enabled=true
-Ddd.integration.jetty.enabled=false
-Ddd.profiling.enabled=true

sy-lee avatar May 08 '25 08:05 sy-lee

Hey @sy-lee, I'm happy to take a look at this on behalf of the profiling team. Did you happen to see an increase in the JVM heap memory as reported by the profiler?

MattAlp avatar May 08 '25 18:05 MattAlp

Hey @sy-lee, I'm happy to take a look at this on behalf of the profiling team. Did you happen to see an increase in the JVM heap memory as reported by the profiler?

This increase is coming out of non-heap memory (from looking at RSS memory metrics) - this is especially obvious for services that have the JVM flag +AlwaysPreTouch enabled, for which we see increased RSS memory in 1.48.2, because this means the increase can only be coming out of non-heap memory. Heap usage remains about the same between the 2 versions. Direct memory profiles between the 2 also did not show any significant differences.

sy-lee avatar May 09 '25 05:05 sy-lee

Thanks for confirming. For us to investigate further, would you mind contacting support via Helpdesk and mentioning this ticket & team?

MattAlp avatar May 13 '25 14:05 MattAlp