Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javaagent causes big heap on high load for Netty instrumentation #5265

Closed
ozoz03 opened this issue Jan 28, 2022 · 7 comments · Fixed by #5282
Closed

javaagent causes big heap on high load for Netty instrumentation #5265

ozoz03 opened this issue Jan 28, 2022 · 7 comments · Fixed by #5282
Labels
bug Something isn't working

Comments

@ozoz03
Copy link
Contributor

ozoz03 commented Jan 28, 2022

Javaagent produces a critical heap increase for Netty instrumentation on our prod env (heap grows persistently over days and is not cleaned up by GC).
We was able to reproduce the issue by a test app with artillery load.

Item-0_and_Item-1_and_Item-0_and_Item-0

Looks like cache that contains FutureListenerWrappers is not properly maintained by GC:
Eclipse_Memory_Analyzer

Steps to reproduce
Here are steps to reproduce: https://github.com/ozoz03/netty-otel-memory-leak/blob/master/README.md

What version are you using?
v1.10.0

Environment
Compiler: openjdk version "11.0.11" 2021-04-20 LTS
OS: macOS 11.6.2, Alpine Linux 3.12.8

@ozoz03 ozoz03 added the bug Something isn't working label Jan 28, 2022
@laurit
Copy link
Contributor

laurit commented Jan 28, 2022

@ozoz03 I ran your sample app and am not convinced that this is a memory leak. If I run your sample app for a bit and perform gc from jconsole before taking a heap dump then all the FutureListenerWrappers are gone. Have you observed an OutOfMemoryError? Or are you just concerned about the space consumed by FutureListenerWrappers.

@ozoz03
Copy link
Contributor Author

ozoz03 commented Jan 28, 2022

@laurit on prod we cannot wait until the oom error happened. we just redeploy.
the problem as I see it, is that gc does not run a full collection by itself and allows heap to grow uncontrolled.

@iNikem
Copy link
Contributor

iNikem commented Jan 31, 2022

@ozoz03 How large heap do you use in your production?

@ozoz03
Copy link
Contributor Author

ozoz03 commented Jan 31, 2022

@iNikem 6g

@laurit
Copy link
Contributor

laurit commented Feb 1, 2022

@ozoz03 If possible could you verify whether the issue you observed is resolved in nightly build https://oss.sonatype.org/content/repositories/snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/1.11.0-SNAPSHOT/

@ozoz03
Copy link
Contributor Author

ozoz03 commented Feb 3, 2022

@laurit thank you a lot.
going to test the build.
will be back in 2-3 days.

@ozoz03
Copy link
Contributor Author

ozoz03 commented Feb 7, 2022

@laurit hey, sorry for the delay.

from what we could see in our graphs the memory leak was still in place with the new snapshot version.
but we believe we found the root cause for the issue and proposed the fix in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants