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

x/exp/inotify: Watcher.paths leaks memory #16097

Closed
krousey opened this issue Jun 17, 2016 · 6 comments
Closed

x/exp/inotify: Watcher.paths leaks memory #16097

krousey opened this issue Jun 17, 2016 · 6 comments

Comments

@krousey
Copy link

krousey commented Jun 17, 2016

inotify.Watcher.RemoveWatch cleans up the Watcher.watches map, but doesn't remove the entry from Watcher.paths.

  1. What version of Go are you using (go version)?

go version go1.6.2 linux/amd64

  1. What operating system and processor architecture are you using (go env)?

linux amd64

  1. What did you do?

Added and removed files from an inotify.Watcher.

https://play.golang.org/p/n95Yttt4Xi

  1. What did you expect to see?

Memory usage not to continually increase.

  1. What did you see instead?

Memory usage steadily increased.

@krousey
Copy link
Author

krousey commented Jun 17, 2016

ref: kubernetes/kubernetes#27456

@krousey
Copy link
Author

krousey commented Jun 21, 2016

I proposed a fix https://go-review.googlesource.com/#/c/24289/

@gopherbot
Copy link

CL https://golang.org/cl/24289 mentions this issue.

@krousey
Copy link
Author

krousey commented Jun 22, 2016

@quentinmit This is my first attempt to contribute to the Go project. Am I missing a step to get a reviewer for the change? Or should I just wait longer?

@ianlancetaylor
Copy link
Contributor

To be honest I'm not sure who is maintaining the exp/inotify project these days.

@ianlancetaylor
Copy link
Contributor

I put some comments on the CL. Thanks for pinging it.

@golang golang locked and limited conversation to collaborators Jun 23, 2017
jhenstridge pushed a commit to jhenstridge/go-inotify that referenced this issue Dec 27, 2022
Watcher.RemoveWatch is failing to clean up the FD to watch path mapping,
leaving them to slowly accumulate over time. This deletes that mapping
while coordinating with the readEvents loop.

Fixes golang/go#16097

Change-Id: I8dcf5212ae54e3adc15347e1ac33000afd862ef7
Reviewed-on: https://go-review.googlesource.com/24289
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants