Skip to content

fix: Prevent ST from holding onto Event refs in memory when aborted#1491

Merged
cwli24 merged 2 commits into
mainfrom
fix-trace-leak
Jun 6, 2025
Merged

fix: Prevent ST from holding onto Event refs in memory when aborted#1491
cwli24 merged 2 commits into
mainfrom
fix-trace-leak

Conversation

@cwli24

@cwli24 cwli24 commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

Releases the Event entries the agent hold onto in Trace after it has aborted. This addresses a known case of memory leak caused by continuing to add those references to a Set that is never cleared.

Overview

Related Issue(s)

https://new-relic.atlassian.net/browse/NR-420780

Testing

Jest added

@github-actions

github-actions Bot commented Jun 4, 2025

Copy link
Copy Markdown

Supportability Metric Usage Changes:

No matching changes found

Supportability Metrics .md File Changes:

supportability_metrics.md was changed? false

New supportability metrics require changes to supportability_metrics.md, as well as a new PR to Angler. Please ensure an Angler PR is created and linked to this PR.

@github-actions

github-actions Bot commented Jun 4, 2025

Copy link
Copy Markdown

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 24.97 kB / 9.47 kB (gzip) 24.97 kB / 9.47 kB (gzip) 0% / 0% (gzip)
lite async-chunk 52.6 kB / 17.45 kB (gzip) 52.6 kB / 17.45 kB (gzip) 0% / 0% (gzip)
pro loader 52.91 kB / 18.61 kB (gzip) 52.91 kB / 18.61 kB (gzip) 0% / -0.02% (gzip)
pro async-chunk 91.84 kB / 28.46 kB (gzip) 92 kB / 28.53 kB (gzip) 0.18% / 0.21% (gzip)
spa loader 61.66 kB / 21.31 kB (gzip) 61.66 kB / 21.31 kB (gzip) 0% / 0% (gzip)
spa async-chunk 116.46 kB / 35.44 kB (gzip) 116.63 kB / 35.49 kB (gzip) 0.14% / 0.16% (gzip)

@github-actions

github-actions Bot commented Jun 4, 2025

Copy link
Copy Markdown

Static Badge

Last ran on June 06, 2025 17:38:12 CDT
Checking merge of (d0f0730) into main (66f5eb8)

@codecov

codecov Bot commented Jun 4, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 59.25926% with 11 lines in your changes missing coverage. Please review.

Project coverage is 87.61%. Comparing base (66f5eb8) to head (d0f0730).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../features/session_trace/aggregate/trace/storage.js 57.69% 7 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1491      +/-   ##
==========================================
- Coverage   87.70%   87.61%   -0.10%     
==========================================
  Files         197      197              
  Lines        7746     7761      +15     
  Branches     1554     1563       +9     
==========================================
+ Hits         6794     6800       +6     
- Misses        820      826       +6     
- Partials      132      135       +3     
Flag Coverage Δ
unit-tests 78.71% <59.25%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ellisong
ellisong previously approved these changes Jun 6, 2025

@ellisong ellisong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/features/session_trace/aggregate/trace/storage.js
Comment thread src/features/session_trace/aggregate/trace/storage.js
Comment thread src/features/session_trace/aggregate/trace/storage.js
Comment thread src/features/session_trace/aggregate/trace/storage.js
Comment thread src/features/session_trace/aggregate/trace/storage.js Outdated
@cwli24 cwli24 merged commit a1d15cb into main Jun 6, 2025
30 of 35 checks passed
@cwli24 cwli24 deleted the fix-trace-leak branch June 6, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants