-
Notifications
You must be signed in to change notification settings - Fork 504
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 when client cache is evicting #1377
Comments
I have confirmed this is a real leak. This exists in the latest build as well. I've taken a heap dump and working on a patch to fix this. |
This change is a simplified implementation of the Builder.Path() and Visitor().ExpandPathsToFileVisitors() functions used by kubectl to parse files and directories. The filepath.Walk() function is used to recursively traverse directories. Every .yaml or .json resource file in the directory is read into its own io.Reader. All the readers are then passed to the YAMLDecoder in the InjectYAML() function. Fixes linkerd#1376 Signed-off-by: ihcsim <[email protected]>
@adleong Please assign this issue to me. |
I've tried to reproduce the memory leak with latest linkerd/namerd and had to modify the demo setup, here are the changes to initial demo setup:
But removing prometheus did not matter, the leak was still reproducing on linkerd 1.0.1.
I've attached the updated demo setup files. |
Results of reproducing the leak with latest linkerd/namerd: screenshots with heap size after a 30 min run and cpu load. After 30 minutes, the heap size increased a little nowhere near the ~400mb you get when reproducing with old linkerd 1.0.1. So, probably the leak is not a issue anymore, but I'd let the demo setup run for longer before reach a conclusion. But I noticed another issue: the CPU load is very high after shrinking the binding cache size from 10 to 9. While before shrinking I noticed a 30% load max, after shrinking it averaged about 150%, so this would be another issue to investigate. |
I don't think this issue was observed recently so most likely you're right. |
Frankly speaking, I have hard time recalling any details, but as @ashald mentioned, we have not been observing any related symptoms for quite a while already. |
First reported by @ashald and @edio.
In a demo setup where the number of destinations exceeds the bindingCache, the linkerd process leaks memory as it adds/removes clients to/from the cache.
The easiest way to reproduce is with this docker-compose setup:
client-memory-issue.zip
Start the demo with:
Then load the linkerd admin dashboard on docker port 9990. The initial setup has 10 destinations and a client cache size of 10. You can see from the dashboard that the heap size for the process hovers at ~85mb.
Next stop the demo:
And edit linkerd.yml to shrink the binding cache size from 10 to 9. Then restart the demo and reload the admin dashboard. You'll see the heap size start to creep up over time. Left running for about 30 minutes, heap will be ~400mb.
The text was updated successfully, but these errors were encountered: