-
Notifications
You must be signed in to change notification settings - Fork 82
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
Memory leak using appsignal lib #820
Comments
Hey @Kalaww, Thanks for opening this issue. If AppSignal leaks memory through the Elixir process, you should be able to see that in Do you have any apps running AppSignal without any custom instrumentation? If not, could you try removing your instrumentation to see if the problem persists? I’ll work on a testing setup to try and reproduce what you’re seeing. Assuming there could be something with your custom instrumentation, could you send me everything custom you’ve added in your app? Also, what value is that graph you posted showing, exactly? |
Thanks, I’m curious to see if that changes the situation. Another place where the memory could potentially go is in the ets table. That should be cleaned of closed spans automatically, but I’d like to know if that’s properly working in your setup. Could you check to see if |
The memory leak is still here when using appsignal without any custom instrumentation. I also tried with elixir 1.14.3 and erlang 25 without success. The only setup so far where I didn't had memory leak is when I removed appsignal completely. |
Thanks for helping us get to the bottom of this. It seems like this isn’t an issue in the Elixir code, then, if you don’t see anything out of the ordinary in the observer. The ets table seems to correctly remove the samples after they’re closed as well. We might be seeing a problem in our extension. Could you check if the memory is increasing over time for the |
I have set the entrypoint of my docker image to use tini. It is suppose to catch these zombie processes. I don't understand everything here and I don't know what create these zombie processes but I don't see the number of processes increases with this fix. I am going to check it during the next few hours to make sure it stays stable. RUN apk add --no-cache tini
ENTRYPOINT [ "/sbin/tini", "--" ] Sources: |
No more memory leak with the fix above. I am closing this issue as the issue is coming from my docker configuration and not from the appsignal lib. Thank you for the help and the fast responses ! |
Hello,
Describe the bug
I am using appsignal in some of my elixir applications and I noticed that these applications
Some of my elixir applications have memory leak. It started happening when I added appsignal to them. I then tested to run my applications without appsignal to see if the memory leak is still there, but the memory leak disappear so the culprit looks to be appsignal.
To Reproduce
I don't really know how to make this reproductible. Here everything I can share about my setup and what I have observed.
erlang 24.3
elixir 1.13.3
appsignal 2.5.0
appsignal_phoenix 2.2.1
My apps are running in a docker container inside a kubernetes cluster.
My appsignal config :
App1 is a simple phoenix web server where
use Appsignal.Phoenix
to my phoenix endpointAppsignal.instrument
App2 is just having a job that push metrics every minute to some appsignal gauges.
The two apps are using appsignal in different ways but both have the memory leak so I guess that it might not be linked to my appsignal integration.
I checked the memory usage of the genserver from appsignal supervisor but it look normal
Here the graph of momery usage of one of my app, we can see here the memory that keep growing until the kubernetes pod reached its limit and restart. The last part of the graph is when I removed appsignal and noticed that memory stayed stable.
I don't know where to look to have more information to trace back the source of the leak. If you have any idea I would highly appreciate it, thanks for taking the time to read
The text was updated successfully, but these errors were encountered: