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 is keeping increase until crash #244

Open
vincentzzh33 opened this issue Sep 28, 2018 · 7 comments · May be fixed by #264
Open

memory is keeping increase until crash #244

vincentzzh33 opened this issue Sep 28, 2018 · 7 comments · May be fixed by #264

Comments

@vincentzzh33
Copy link

newStandardMeter newEWMA these two memory is keeping increase until crash when i using sarama as httpserver to receive kafka request

@shriram1993
Copy link

Yes!! We are also facing memory leak in newStandardMeter & newEWMA. Attached pprof graph screenshot for reference. Please help.
screenshot-localhost-8081-2019 05 01-12-14-14

@shriram1993
Copy link

Yes!! We are also facing memory leak in newStandardMeter & newEWMA. Attached pprof graph screenshot for reference. Please help.
screenshot-localhost-8081-2019 05 01-12-14-14

If you need more info, I can provide.

@shriram1993
Copy link

Any Update on this?

@luzhuqun
Copy link

luzhuqun commented Jun 5, 2019

Any Update?

@michaelschlies
Copy link

michaelschlies commented Aug 18, 2019

Is anyone that is running into this registering their Meters with the registry in go-metrics? I just refactored registry to use a sync.Map instead of a mutex managed map and removing its switch() for what to allow to register and my memory leaks have completely stopped. In my case it kept calling NewStandardMeter or NewEWMA because the metrics didn't exist in the registry already

@luzhuqun @shriram1993 @vincentzzh33

@omgommt
Copy link

omgommt commented Oct 14, 2020

Identified the issue:
Its happening because we are passing NewMetric object with every metric log. Instead it should be function, which will be called when new Metric object is required.

Before:
.RcRegistry.GetOrRegister(timerName, rcmetric.NewTimer()).(rcmetric.Timer)

After: (Correct)
.RcRegistry.GetOrRegister(timerName, rcmetric.NewTimer).(rcmetric.Timer)

@omgommt
Copy link

omgommt commented Oct 14, 2020

Any Update on this?

Identified the issue:
Its happening because we are passing NewMetric object with every metric log. Instead it should be function, which will be called when new Metric object is required.

Before:
.RcRegistry.GetOrRegister(timerName, rcmetric.NewTimer()).(rcmetric.Timer)

After: (Correct)
.RcRegistry.GetOrRegister(timerName, rcmetric.NewTimer).(rcmetric.Timer)

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