Closed cwli24 closed 2 months ago
Merging this pull request will result in the following asset size changes: |
Agent | Asset | Previous Size | New Size | Diff |
---|---|---|---|---|---|
lite | loader | 34.16 kB / 11.9 kB (gzip) | 34.25 kB / 11.92 kB (gzip) | 0.26% / 0.16% (gzip) | |
lite | async-chunk | 50.09 kB / 16.18 kB (gzip) | 50.09 kB / 16.18 kB (gzip) | 0% / 0% (gzip) | |
pro | loader | 54.83 kB / 18.55 kB (gzip) | 54.92 kB / 18.57 kB (gzip) | 0.16% / 0.11% (gzip) | |
pro | async-chunk | 96.73 kB / 28.99 kB (gzip) | 96.73 kB / 28.99 kB (gzip) | 0% / 0% (gzip) | |
spa | loader | 62.77 kB / 20.97 kB (gzip) | 62.86 kB / 21 kB (gzip) | 0.14% / 0.14% (gzip) | |
spa | async-chunk | 111.84 kB / 33.37 kB (gzip) | 111.84 kB / 33.37 kB (gzip) | 0% / 0% (gzip) | |
lite-polyfills | loader | 127.79 kB / 41.22 kB (gzip) | 127.83 kB / 41.24 kB (gzip) | 0.03% / 0.04% (gzip) | |
lite-polyfills | async-chunk | 63.99 kB / 18.45 kB (gzip) | 63.99 kB / 18.45 kB (gzip) | 0% / 0% (gzip) | |
pro-polyfills | loader | 150.17 kB / 47.51 kB (gzip) | 150.21 kB / 47.54 kB (gzip) | 0.03% / 0.05% (gzip) | |
pro-polyfills | async-chunk | 116.73 kB / 31.22 kB (gzip) | 116.73 kB / 31.22 kB (gzip) | 0% / 0% (gzip) | |
spa-polyfills | loader | 158.37 kB / 49.67 kB (gzip) | 158.41 kB / 49.69 kB (gzip) | 0.03% / 0.04% (gzip) | |
spa-polyfills | async-chunk | 133.71 kB / 35.92 kB (gzip) | 133.71 kB / 35.92 kB (gzip) | 0% / 0% (gzip) |
Last ran on July 09, 2024 11:59:53 CDT
Checking merge of (d6f1e8dff62a7a056d34499d34cb933d3c92fdb5) into main (3d815a3988583911322541007bd5e176a5bba4c1)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.63%. Comparing base (
3d815a3
) to head (c4d8ba5
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I did some manual testing locally. Here are my findings.
Looks like the backlog is getting cleared correctly when SR and ST are enabled in the agent config but RUM responds with a 0.
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 *
: