-
Notifications
You must be signed in to change notification settings - Fork 565
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
How to client.Close()? #222
Comments
Hi @didip, since go-dockerclient will just send HTTP requests, it forwards handling of connections to the default HTTP client in the Go standard library. You can also customize the HTTP client to be used and customize when to close connections. |
Somewhat related to my original question. I've noticed that memory consumptions grow when I loop and fetch containers/images data. The pseudo-code looks like this:
the go-dockerclient code itself looks sane, you guys call Should I create a new separate issue for this? |
Hey @didip, I think we can keep this issue, for further investigation. I will try to reproduce and fix the issue locally. Thanks for reporting! |
@didip I've created this small reproducer:
Running with 8 goroutines and 1ms interval, it rapidly grows to ~6.6MB of memory usage, and then stop growing. I think it should not grow that much, but it's indeed stopping growing. I've tried with 64 goroutines and reached the top around 8.0MB. I will do some profiling, but could you share more information on your environment, like the OS, Docker and Go version? Here is the Docer server environment that I tested:
Here is the environment where I ran the client code:
Thank you again! |
Thanks for investigating this so quickly!
Go version is: |
I can also show the code: https://github.com/resourced/resourced/blob/master/libdocker/libdocker.go
Globally pooling docker connections helps the problem a bit, but memory is still growing. |
We found the memory leak and its in our code. Sorry for the false alarm. |
Hi @didip, sorry for the delay, and thanks for the feedback, please feel free to open new issues in the future! |
I must have missed the obvious thing, how do I close docker client connection?
The text was updated successfully, but these errors were encountered: