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 leak in Analyzer #21

Closed
earthgecko opened this issue Aug 14, 2016 · 1 comment
Closed

Memory leak in Analyzer #21

earthgecko opened this issue Aug 14, 2016 · 1 comment
Assignees
Labels

Comments

@earthgecko
Copy link
Owner

Analyzer memory leaks under certain conditions in relation to Mirage, an unused Mirage list that is being appended too but not reset and matplotlib savefig in the alerters context.

@earthgecko earthgecko added the bug label Aug 14, 2016
@earthgecko earthgecko self-assigned this Aug 14, 2016
earthgecko added a commit that referenced this issue Aug 14, 2016
- Moved trigger_alert to a multiprocessing process when the alert is smtp. This
  is used by smtp alerters so that matplotlib objects are cleared down and the
  alerter cannot create a memory leak in this manner as plt.savefig keeps the
  object in memory until the process terminates.  Seeing as data is being
  surfaced and processed in the alert_smtp context, multiprocessing the alert
  creation and handling prevents any memory leaks in the parent. This fixes
  Issue #21 Memory leak in Analyzer - #21
  internal ref #1558: Memory leak in Analyzer
- In agent del the algorithm test objects to free the memory
- Applied in both Analyzer and Mirage
- Some pyflakes linting done
- Reintroduced the original alert substring matching AFTER wildcard matching, to
  allow more flexibility
- In Analyzer streamlined the Mirage metrics a bit
- Added some settings vaidation in the agents

Added:
skyline/validate_settings.py
Modified:
skyline/analyzer/agent.py
skyline/analyzer/analyzer.py
skyline/analyzer/alerters.py
skyline/mirage/agent.py
skyline/mirage/mirage.py
skyline/mirage/mirage_alerters.py
earthgecko added a commit that referenced this issue Aug 14, 2016
- Moved trigger_alert to a multiprocessing process when the alert is smtp. This
  is used by smtp alerters so that matplotlib objects are cleared down and the
  alerter cannot create a memory leak in this manner as plt.savefig keeps the
  object in memory until the process terminates.  Seeing as data is being
  surfaced and processed in the alert_smtp context, multiprocessing the alert
  creation and handling prevents any memory leaks in the parent. This fixes
  Issue #21 Memory leak in Analyzer - #21
  internal ref #1558: Memory leak in Analyzer
- In agent del the algorithm test objects to free the memory
- Applied in both Analyzer and Mirage
- Some pyflakes linting done
- Reintroduced the original alert substring matching AFTER wildcard matching, to
  allow more flexibility
- In Analyzer streamlined the Mirage metrics a bit
- Added some settings vaidation in the agents

Added:
skyline/validate_settings.py
Modified:
skyline/analyzer/agent.py
skyline/analyzer/analyzer.py
skyline/analyzer/alerters.py
skyline/mirage/agent.py
skyline/mirage/mirage.py
skyline/mirage/mirage_alerters.py
@earthgecko
Copy link
Owner Author

Moved trigger_alert to a multiprocessing process when the alert is smtp. This is used by smtp alerters so that matplotlib objects are cleared down and the alerter cannot create a memory leak in this manner as plt.savefig keeps the object in memory until the process terminates. Seeing as data is being surfaced and processed in the alert_smtp context, multiprocessing the alert creation and handling prevents any memory leaks in the parent.

Removed the unused but appended to self.mirage_metrics.append(metric) list from Analyzer.

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

No branches or pull requests

1 participant