René's URL Explorer Experiment


Title: Memory leak: frozen Nest `Create Nest App` span retains unbounded `_sentryChildSpans` (SDK ≥10.64; mitigated by `openTelemetryBasicTracerProvider: true`, which #22557 removes) · Issue #22860 · getsentry/sentry-javascript · GitHub

Open Graph Title: Memory leak: frozen Nest `Create Nest App` span retains unbounded `_sentryChildSpans` (SDK ≥10.64; mitigated by `openTelemetryBasicTracerProvider: true`, which #22557 removes) · Issue #22860 · getsentry/sentry-javascript

X Title: Memory leak: frozen Nest `Create Nest App` span retains unbounded `_sentryChildSpans` (SDK ≥10.64; mitigated by `openTelemetryBasicTracerProvider: true`, which #22557 removes) · Issue #22860 · getsentry/sentry-javascript

Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...

Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/22860

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Memory leak: frozen Nest `Create Nest App` span retains unbounded `_sentryChildSpans` (SDK ≥10.64; mitigated by `openTelemetryBasicTracerProvider: true`, which #22557 removes)","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSelf-hosted/on-premise\n\n### Which SDK are you using?\n\n@sentry/nestjs\n\n### SDK Version\n\n10.66.0\n\n### Framework Version\n\nNestJS 11\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nSDK ≥10.64\n\n`Sentry.init({\n  debug: false,\n  dsn: config.SENTRY_DSN,\n  enabled: isPreproductionOrProduction(),\n  enableMetrics: false,\n  tracesSampleRate: 0,\n  environment: config.NODE_ENV,\n  release: version,\n})`\n\n### Steps to Reproduce\n\n1. Nest app with `@sentry/nestjs` (SDK ≥10.64) + `SentryModule.forRoot()`, `Sentry.init({ tracesSampleRate: 0 })`\n2. Run under sustained HTTP / messaging load for ≥1h\n3. Force GC and compare `old_space` / take heap snapshots\n\n### Expected Result\n\n- An ended / frozen span should not keep accumulating children, **or**\n- `_sentryChildSpans` should be cleared / bounded when a span ends, **or**\n- Bootstrap / `app_creation` spans should not remain active parents after Nest boot completes\n\n### Actual Result\n\nEnded `Create Nest App` span retains an unbounded `_sentryChildSpans` set for process lifetime → continuous `Scope` / `SentryNonRecordingSpan` growth even with `tracesSampleRate: 0`.\n\n### Additional Context\n\nAfter upgrading from `@sentry/nestjs@10.62.0`, a long-lived Nest service’s JS heap grew ~**80 MB/h** under production traffic and never reclaimed on forced GC.\n\nHeap snapshots ~ 70 minutes apart showed almost 1:1 growth of `Scope` and `SentryNonRecordingSpan` (~ +176k each). Retention was dominated by a single root span:\n\n- **name:** `Create Nest App`\n- **op / attrs:** `app_creation.nestjs`, `sentry.origin=auto.http.otel.nestjs`, `nestjs.module=AppModule`\n- **`_sentryChildSpans`:** ~**154k** direct children (of ~233k total child links in the heap)\n- Span also carried **`sentry.tracerProviderSpan`** (marker for spans from Sentry’s minimal tracer provider)\n\nImportant: this root span was **already ended / frozen** (`_frozen: true`, `_status` set). It still kept receiving children via `addChildSpanToSpan` into a strong `Set` (`_sentryChildSpans`), so memory grew for the lifetime of the process.\n\nObserved constructor deltas (shallow, ~70 min):\n\n| Constructor | Δ count | Δ shallow |\n|---|---:|---:|\n| `Object` | +1.09M | +55 MB |\n| `Scope` | +176k | +31 MB |\n| `Array` | +709k | +22 MB |\n| `SentryNonRecordingSpan` | +176k | +19 MB |\n| `WeakRef` | +528k | +16 MB |\n\nDominant retainer shape:\n\n```\nScope ←_sentryScope— SentryNonRecordingSpan ←(Set)— _sentryChildSpans ← SentrySpan(\"Create Nest App\")\n```\n\nSame growth pattern appeared on a second service after the same SDK bump, at a lower rate matching lower traffic — points away from app-specific code.\n\n## Suspected regression\n\n**10.64.0** introduced default use of Sentry’s minimal `SentryTracerProvider` instead of the full OTel `BasicTracerProvider`:\n\n- [https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md (10.64.0)](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#10640)\n- PRs: https://github.com/getsentry/sentry-javascript/pull/21666, https://github.com/getsentry/sentry-javascript/pull/21680, https://github.com/getsentry/sentry-javascript/pull/21842\n\nThe leaking root is created by Nest instrumentation (`getAppCreationSpanOptions` / orchestrion `NESTJS_APP_CREATION` → `startInactiveSpan`). Children are attached via `addChildSpanToSpan` in `@sentry/core` with no guard for an already-ended parent and no upper bound on `_sentryChildSpans`.\n\nRelated prior discussion (different trigger, same “never-pruned root span” failure mode): https://github.com/getsentry/sentry-javascript/issues/13412  \nUpstream WeakRef work (#21242) is present in 10.66 but does **not** stop strong retention through `_sentryChildSpans`.\n\n## Workaround (confirmed on our prod)\n\n```ts\nSentry.init({\n  // ...\n  openTelemetryBasicTracerProvider: true,\n})\n```\n\nAfter deploying this, container memory on the affected Nest service returned to a flat profile.\n\nThe `httpIntegration({ ignoreOutgoingRequests: () => true })` workaround from #13412 does **not** apply: the accumulator is the Nest `app_creation` span, not an outgoing HTTP/WebSocket span.\n\n## Note on the workaround's lifetime\n\n`openTelemetryBasicTracerProvider: true` is currently our only mitigation. [#22557](https://github.com/getsentry/sentry-javascript/pull/22557) (merged to `develop`, not yet in a published release as of **10.69.0**) removes this option along with `SentrySpanProcessor` / `SentrySampler`.\n\nOnce that lands, TypeScript will reject the option as unknown. Deleting it to silence the error silently reintroduces the leak, because `initOtel` no longer has an opt-out and the minimal `SentryTracerProvider` becomes the only path.\n\nIf the accumulation is inherent to `SentryTracerProvider`, removing the opt-out leaves affected Nest services with no mitigation short of disabling Sentry. Relevant to the direction in [#22486](https://github.com/getsentry/sentry-javascript/issues/22486).\n\nHappy to provide redacted heap-snapshot excerpts / retainer dumps if needed.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/m3Lith","@type":"Person","name":"m3Lith"},"datePublished":"2026-07-30T11:57:26Z","url":"https://github.com/getsentry/sentry-javascript/issues/22860"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:98541914-6efb-dd3d-5b0c-e61b07a0be31
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA2FE:1B5E62:221207:2FAAB5:6B043936
html-safe-nonce4003105180bb56356dd62055a7973e536f88003dd5ca50812021a9a2a7f90984
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkZFOjFCNUU2MjoyMjEyMDc6MkZBQUI1OjZCMDQzOTM2IiwidmlzaXRvcl9pZCI6IjIyNjU4NjY5NDE0NzY2NDkyNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac91523bfab14e1a5530dbcb7a131096cf2d2f3a5ab28b99c9144c2ca2eaae605b
hovercard-subject-tagissue:5019451611
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/22860/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d54b711c332d453350626433587a23969ba87006e20db8dbd663eb79b6daa5b7/getsentry/sentry-javascript/issues/22860
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d54b711c332d453350626433587a23969ba87006e20db8dbd663eb79b6daa5b7/getsentry/sentry-javascript/issues/22860
og:image:altIs there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamem3Lith
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/22860#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F22860
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F22860
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22860
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22860
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22860
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests55 (55)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22860
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22860
#22916https://github.com/getsentry/sentry-javascript/pull/22916
Memory leak: frozen Nest Create Nest App span retains unbounded _sentryChildSpans (SDK ≥10.64; mitigated by openTelemetryBasicTracerProvider: true, which #22557 removes)https://github.com/getsentry/sentry-javascript/issues/22860#top
#22916https://github.com/getsentry/sentry-javascript/pull/22916
https://github.com/andreiborza
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Nest.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Nest.js%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
https://github.com/m3Lith
m3Lithhttps://github.com/m3Lith
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#issue-5019451611
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md (10.64.0)https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#10640
feat(opentelemetry): Add SentryTracerProvider #21666https://github.com/getsentry/sentry-javascript/pull/21666
feat(node): Wire up SentryTracerProvider #21680https://github.com/getsentry/sentry-javascript/pull/21680
feat(core): Seal SentryTracerProvider spans against mutation after they end #21842https://github.com/getsentry/sentry-javascript/pull/21842
#13412https://github.com/getsentry/sentry-javascript/issues/13412
#21242https://github.com/getsentry/sentry-javascript/pull/21242
#13412https://github.com/getsentry/sentry-javascript/issues/13412
#22557https://github.com/getsentry/sentry-javascript/pull/22557
#22486https://github.com/getsentry/sentry-javascript/issues/22486
m3Lithhttps://github.com/m3Lith
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718417509
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718418624
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#issuecomment-5130518837
Linear Codehttps://linear.app
JS-3235https://linear.app/getsentry/issue/JS-3235
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718426473
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860
github-actionshttps://github.com/apps/github-actions
Nest.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Nest.js%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718426208
linear-codehttps://github.com/apps/linear-code
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718453560
https://github.com/andreiborza
andreiborzahttps://github.com/andreiborza
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#issuecomment-5130574272
@m3Lithhttps://github.com/m3Lith
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718703411
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860
andreiborzahttps://github.com/andreiborza
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-28718760135
andreiborzahttps://github.com/andreiborza
on Aug 13, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-29403323164
fix(core): Bound child span tracking on long-lived spans (#22916)https://github.com/getsentry/sentry-javascript/commit/152d6ed0c13a28d81016665b3d8af9a716f70d2a
#22916https://github.com/getsentry/sentry-javascript/pull/22916
https://docs.github.com/articles/closing-issues-via-commit-messages
152d6edhttps://github.com/getsentry/sentry-javascript/commit/152d6ed0c13a28d81016665b3d8af9a716f70d2a
andreiborzahttps://github.com/andreiborza
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#22916https://github.com/getsentry/sentry-javascript/pull/22916
on Aug 13, 2026https://github.com/getsentry/sentry-javascript/issues/22860#event-29403323229
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/22860
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22860
andreiborzahttps://github.com/andreiborza
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Nest.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Nest.js%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.