Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

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?

@AIRootUser
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants