这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Conversation

@noblehng
Copy link
Contributor

Defer close http response body in sendMetadata().

The http response body doesn't get closed after sendMetada() return,
which will cause two goroutines and quite some memory leak every hour.

Scollector on our haproxy boxs got to the internal 500 MiB memory limit and
panic crashed within a week. I analyzed the crash log and graphed memory
usage and goroutine count metrics of scollector, then found out the problem.

Metrics are really great for identifying this kind of problems, and I want to say
a big thank you for your great work building bosun and scollector.

Defer close http response body in sendMetadata().

The http response body doesn't get closed after sendMetada() return,
which will cause two goroutines and quite some memory leak every hour.
@kylebrandt
Copy link
Member

@noblehng Did you use bosun/scollector to find the leak in scollector? That would be a fun screenshot - thanks for spotting this!

kylebrandt added a commit that referenced this pull request Nov 20, 2015
metadata: fix a goroutine and memory leak in sendMetadata()
@kylebrandt kylebrandt merged commit 855eb85 into bosun-monitor:master Nov 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants