-
Notifications
You must be signed in to change notification settings - Fork 383
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
bug: leaking memory and goroutines #3016
Comments
I tried to examine my samples and read after the usual suspects of goroutine leakage. Next to Excerpts:
The referenced code lines: Most probably at least one of these are valid leak point (due to missing/impossible receival data on the channel).
|
I tried to understand how While reading the code I found a comment:
It raises the concern, what could I check to ensure that my app behaves (using the API) correctly? Apart, what else should I check or try to help with this issue? |
If you are in the position to try the |
Same. OCI image:
|
I am up for making an env/app to reproduce this. (if I got you correctly about the replication of the issue) However, I don't know how hard it will be (time-wise). |
I got advice (from my college) to find out what was the point when the leak started. |
As we moved a lot of things now and in the process lost some tooling I am going to try to create an observable development setup on my end today. If you could create simple replicable we could "run". |
I managed to make a simple app/environment to reproduce the issue: https://github.com/adrianrobotka/kcp-demo Against my expectations, the simplest possible controller will also cause leakage. Details in the readme of the linked repo. |
Describe the bug
KCP consumes increasing amount of memory until OOM killed. While looking at other metrics from its exporter, I found that the number of goroutines shows a high correlation with memory consumption. Due to the high number of goroutines, I suspect a resource-leak type programming error.
Steps To Reproduce
I used the
ghcr.io/kcp-dev/kcp:0531e126
image in Kubernetes which corresponds to v0.20.0.My application has the following dimensions in order of magnitudes:
>>10
secExpected Behaviour
Don’t consume all the memory that is given.
Additional Context
I used
pprof
to profile KCP remotely. All the captures are available in the zip file.all zipped
go tool trace
Goroutine profile as text: pprof-goroutine.txt
Goroutine profile as as SVG: pprof-goroutines.svg
Heap profile as text: pprof-heap.txt
Heap profile as SVG: pprof-heap
Memory allocations as SVG: pprof-allocs.svg
Memory allocation as text: pprof-allocs.txt
The text was updated successfully, but these errors were encountered: