-
Notifications
You must be signed in to change notification settings - Fork 458
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
Performance Counter Instances Never Removed #146
Comments
@mackenzieajudd I'm don't think the intention of the Windsor performance counters was to be used in production always enabled, there shouldn't be any harm though other than this defect obviously. However, won't an application restart cause IIS to tear down the application pool process without really "shutting down" applications resulting in the same outcome? The code currently calls Any chance you could provide a pull request with the fix? |
@jonorossi thanks for the quick response! You may be right about the IIS teardown I'm not sure. From what I can see In our case Windsor creates a new performance counter each time because its name is unique (Based on process name and id) to account for multiple instances being tracked at the same time. Because it's not re-using an existing performance counter instance I think the instance should be removed when Windsor is done with it so they don't pile up. I'll put something together and hopefully have a pull request this week! I've attached a picture to help illustrate what I'm talking about. The performance counters shown in it have all been created by Windsor but where not removed when the container was disposed and the application was closed. |
@mackenzieajudd sounds logical to remove the instance on container shutdown, they are obviously pretty useless once the container has shutdown. I'd leave the category around though. Have you looked at setting |
You'd also have to change the constructor usage of |
Thanks @jonorossi! I opened a pull request fixing this. |
Fix for issue #146: Performance Counter Instances Never Removed
We ran into a "Custom counters file view is out of memory" exception in our application running in IIS which brought this issue to light.
We have performance counters enabled as instructed here: https://github.com/castleproject/Windsor/blob/master/docs/performance-counters.md
I found that the TrackedComponentsPerformanceCounterWrapper class never removes the PerformanceCounter instance that it wraps on disposal. If performance counters are enabled for an application which is restarted often the available performance counter memory can be exhausted because a new performance counter, with a unique name, is created every time on startup.
It would be nice if TrackedComponentsPerformanceCounterWrapper removed the wrapped performance counter instance on disposal.
To reproduce:
The text was updated successfully, but these errors were encountered: