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

Memory leak? #2

Closed
ottob opened this issue Nov 20, 2012 · 2 comments
Closed

Memory leak? #2

ottob opened this issue Nov 20, 2012 · 2 comments

Comments

@ottob
Copy link

ottob commented Nov 20, 2012

Hi, thanks for your fantastic blog posts, they really helped me get going with go.

Today I came upon this thread: https://groups.google.com/forum/?fromgroups=#!topic/gorilla-web/clJfCzenuWY

If I understand this correctly a defer context.Clear(req) might be needed in the ServerHTTP function in the http.go file to make sure that we do not leak memory. Or am I mistaken?

@zeebo
Copy link
Owner

zeebo commented Nov 20, 2012

You had me on my toes for a minute there, but it's actually ok. Since we're using the pat package, it uses the mux package, so everything goes through the (*mux.Router).ServeHTTP method which cleans up.

https://github.com/gorilla/mux/blob/master/mux.go#L85

@zeebo zeebo closed this as completed Nov 20, 2012
@ottob
Copy link
Author

ottob commented Nov 20, 2012

Great, thanks for clearing this up for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants