-
Notifications
You must be signed in to change notification settings - Fork 786
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
Reduce memory usage by reclaimed MetricPoint #5416
Reduce memory usage by reclaimed MetricPoint #5416
Conversation
4dd3bf5
to
57fec34
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5416 +/- ##
==========================================
+ Coverage 83.38% 84.70% +1.32%
==========================================
Files 297 281 -16
Lines 12531 12105 -426
==========================================
- Hits 10449 10254 -195
+ Misses 2082 1851 -231
Flags with carried forward coverage won't be shown. Click here to find out more.
|
internal void Reclaim() | ||
{ | ||
this.LookupData = null; | ||
this.mpComponents = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ Thank you!
@specialforest Thanks for this PR! |
Changes
Current MetricPoint reclaim mechanism leaves lots of unused objects in memory (histogram buckets, exemplar). With this change these objects can be garbage collected.
Tested with a sample program:
Heap snapshot before the change:
Heap snapshot after the change:
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes