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

can`t release memory after completelyDisableMetrics #17

Closed
biuboombiuboom opened this issue Apr 22, 2016 · 3 comments
Closed

can`t release memory after completelyDisableMetrics #17

biuboombiuboom opened this issue Apr 22, 2016 · 3 comments

Comments

@biuboombiuboom
Copy link

Because class 'HistogramMetric' doesn't implement Interface 'IDisposable' ,so disable a metricContext can not disable histogram, class 'HistogramMetric' have a field reservoir,if the reservoirs type is 'ExponentiallyDecayingReservoir', the memory will cant be release.

@Liwoj
Copy link
Contributor

Liwoj commented Apr 22, 2016

Not true imho.
Call to MetricsContext.CompletelyDisableMetrics will clear all repositories -> HistogramMetric instances are not referenced anywhere and will be garbage collected together with its reservoirs. IDisposable is not needed most of the time in .NET unless you dealing with unmanaged resources....

@hinteadan
Copy link
Member

Agreed with @Liwoj. Will close this.

@biuboombiuboom
Copy link
Author

biuboombiuboom commented May 30, 2016

@Liwoj @hinteadan ”ExponentiallyDecayingReservoir“ this reservorir have a "Scheduler", this "Scheduler" Could not be released and "HistogramMetric" do not implement the interface "IDisposable " , so the instance of the "HistogramMetric' cant be released,you can test to
etishor/Metrics.NET#124

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

3 participants