cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace + OkHttp3 memory leak

tmay
Newcomer

Hi,

We believe we've stumbled on a memory leak caused by the Dynatrace default interceptor.

We observed applications mysteriously restarting due to OOMs. Upon further investigation (jemalloc tuning), it was revealed that the native memory allocator from the Dynatrace native lib was hoarding twice our heap in memory.

Here's a picture of the relevant allocation stack showing this.

tmay_0-1752511446527.png

And because I'm sure it's useful, here's the one agent version information in a copy/pasteable form

/opt/dynatrace/oneagent-paas/agent/bin/1.315.68.20250627-182234/linux-x86-64/liboneagentjava.so

We've observed that switching to a non-OkHttpClient client fixes this problem.

Here's another shot of one of the paths taken

tmay_1-1752511682761.png

It appears that memory allocated by `CorrelationNative` isn't being properly (or timely) released for the OkHttp integration.

1 REPLY 1

AgataWlodarczyk
Community Team
Community Team

@tmay Thank you very much for providing the feedback and solution!

When passion meets people magic and innovation happen.

Featured Posts