-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: Release backlog memory when features are blocked by RUM #1102
Conversation
Asset Size Report
Merging this pull request will result in the following asset size changes:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1102 +/- ##
=======================================
Coverage 87.62% 87.63%
=======================================
Files 162 162
Lines 7259 7263 +4
Branches 1423 1426 +3
=======================================
+ Hits 6361 6365 +4
Misses 782 782
Partials 116 116
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Patrick Housley <patrickhousley@users.noreply.github.com>
Plug a memory leak in Session Trace and other features. When entitlement or enable flag from RUM request returns a 0 for a feature, the agent will now release the reference to the events buffer under that feature so it can be garbage collected.
Overview
The pre-load cycle of the agent sets up listeners and buffers events in a backlog and an internal handlers object to be flushed and processed after the page loads. It was discovered that if the RUM call getting made post-load returns a
0
for an applicable feature, those things are never cleared for such feature. This caused the backlog for instance to indefinitely hold onto events awaiting processing, consuming memory. This fix will flush those events in such cases when the features are not activated via thederegisterDrain
call made by each.Related Issue(s)
https://new-relic.atlassian.net/browse/NR-284960
This issue was also seen in other features and have been addressed together.
Testing
New e2e on

-b *
: