Title: [7.0 regression] Unbounded type relation expansion during variance computation causes OOM · Issue #64423 · microsoft/TypeScript · GitHub
Open Graph Title: [7.0 regression] Unbounded type relation expansion during variance computation causes OOM · Issue #64423 · microsoft/TypeScript
X Title: [7.0 regression] Unbounded type relation expansion during variance computation causes OOM · Issue #64423 · microsoft/TypeScript
Description: 🔎 Search Terms typescript 7.0.2 tsc noEmit out of memory typescript-go checker Relater recursiveTypeRelatedTo memory typescript 7 silent typecheck hang 🕗 Version & Regression Information The project was using TypeScript 7.0.2 when tsc --...
Open Graph Description: 🔎 Search Terms typescript 7.0.2 tsc noEmit out of memory typescript-go checker Relater recursiveTypeRelatedTo memory typescript 7 silent typecheck hang 🕗 Version & Regression Information The projec...
X Description: 🔎 Search Terms typescript 7.0.2 tsc noEmit out of memory typescript-go checker Relater recursiveTypeRelatedTo memory typescript 7 silent typecheck hang 🕗 Version & Regression Information The pr...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/64423
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[7.0 regression] Unbounded type relation expansion during variance computation causes OOM","articleBody":"### 🔎 Search Terms\n\n- `typescript 7.0.2 tsc noEmit out of memory`\n- `typescript-go checker Relater recursiveTypeRelatedTo memory`\n- `typescript 7 silent typecheck hang`\n\n### 🕗 Version & Regression Information\n\nThe project was using TypeScript 7.0.2 when `tsc --noEmit` stopped returning and consumed increasing memory. We switched the primary compiler dependency to TypeScript 6.0.3 and kept 7.0.2 installed as an npm alias so we could run both versions on the **same source tree and configuration**. TypeScript 6.0.3 completes successfully; 7.0.2 runs out of memory under a 6 GiB virtual-address limit.\n\nWe have not bisected TypeScript 7 releases, so we cannot identify the first affected TypeScript 7 version. The original uncapped run did not complete; the bounded failure described below is reproducible.\n\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\nThis is a private React 19/TypeScript project with TSX application code, types, E2E tests, and Vite/Playwright configuration. Relevant `tsconfig.json` settings (excerpt, **not** a standalone reproduction):\n\n```json\n{\n \"compilerOptions\": {\n \"strict\": true,\n \"jsx\": \"react-jsx\",\n \"moduleResolution\": \"bundler\",\n \"skipLibCheck\": true,\n \"composite\": true,\n \"incremental\": true,\n \"noEmit\": true\n }\n}\n```\n\nThe config includes `src/**/*`, `types/**/*`, and `e2e/**/*`, plus config files, and excludes `node_modules` and the local rendering dependency. The project's typecheck script is `tsc --noEmit`. With dependencies installed in this private project, these commands compare both compilers on the same checkout (the alias `typescript7` points to `typescript@7.0.2`):\n\n```sh\nnode_modules/typescript/bin/tsc --noEmit --pretty false --incremental false --composite false\n\nprlimit --as=6442450944 -- node_modules/typescript7/bin/tsc --noEmit --pretty false --incremental false --composite false\n\nprlimit --as=6442450944 -- node_modules/typescript7/bin/tsc --noEmit --noCheck --pretty false --incremental false --composite false\n```\n\nBoth full-check commands disable incremental/composite mode to avoid build-cache effects. The `prlimit` cap prevents the native TypeScript 7 binary from exhausting the host's memory.\n\n\n### 🙁 Actual behavior\n\nTypeScript 7.0.2 produces no compiler progress, diagnostic, or error output while memory grows; the original uncapped run never returned. The developer also observed **no compiler output even with verbose logging enabled**. In a bounded run, the first output appears only when the Go runtime runs out of memory:\n\n```text\nruntime: out of memory: cannot allocate 4194304-byte block (5082873856 in use)\nfatal error: out of memory\n```\n\nWith a 6 GiB virtual-address limit, the TypeScript 7 check exited with status 2 after about 36 seconds and roughly 4.8 GiB peak RSS (three runs). The same source tree completed under TypeScript 6.0.3 without diagnostics.\n\n\n### 🙂 Expected behavior\n\nThe full TypeScript 7 typecheck should finish or report actionable diagnostics without exhausting available memory on a project that TypeScript 6 checks successfully. If it cannot finish, it should not silently consume memory without producing useful output.\n\n\n### Additional information about the issue\n\nEnvironment: Linux x64, 8 available CPUs, 15 GiB physical memory, 8 GiB swap, Node.js v26.8.0-alpha.0.0.0. TypeScript 7.0.2 uses its native Linux x64 Go compiler.\n\nMeasurements used `/usr/bin/time -f 'elapsed=%e max_rss_kb=%M exit=%x'` with a 90-second timeout. The TypeScript 6 run had no address-space cap; the TypeScript 7 runs had a 6 GiB virtual-address cap.\n\n| Compiler / mode | Elapsed | Peak RSS | Result |\n| ------------------ | ------: | ------------: | ----------------------------------------- |\n| 6.0.3, full check | 47.87 s | 2,868,588 KiB | Exit 0, no diagnostics |\n| 7.0.2, full check | 36.48 s | 5,026,492 KiB | Exit 2, out of memory; reproduced 3 times |\n| 7.0.2, `--noCheck` | 1.42 s | 685,224 KiB | Exit 0 |\n\nThe `--noCheck` result suggests the expensive work happens during semantic checking. The Go traceback includes repeated `github.com/microsoft/typescript-go/internal/checker.(*Relater).recursiveTypeRelatedTo` frames and `checker.(*Checker).getDiagnostics` calls. We have not determined whether this is a leak or unusually expensive type relations. No public minimal repro is available yet because the project is private.\n","author":{"url":"https://github.com/Amatewasu","@type":"Person","name":"Amatewasu"},"datePublished":"2026-09-24T09:51:20Z","url":"https://github.com/microsoft/TypeScript/issues/64423"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9fe82127-5b88-cad7-aa51-ce5536187185 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E026:3CBB3E:162AC46:1C2CD90:6B017757 |
| html-safe-nonce | 960f79824fba63c2cfeb31ac80b0b4efe4120cca3fc43120afae53d91f6e495e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDI2OjNDQkIzRToxNjJBQzQ2OjFDMkNEOTA6NkIwMTc3NTciLCJ2aXNpdG9yX2lkIjoiMjE1NTk2Mjc1Mjc1NjE4NDkxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b83ad329b40e2a829cfe77c13f3fe5cd47f62c37a25bb70fe02f36ea65afdad3 |
| hovercard-subject-tag | issue:5566488569 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/64423/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a01ec6c8d6425e8bc2275f08f3834745222535b60320ed8e29e170ef223ccaf1/microsoft/TypeScript/issues/64423 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a01ec6c8d6425e8bc2275f08f3834745222535b60320ed8e29e170ef223ccaf1/microsoft/TypeScript/issues/64423 |
| og:image:alt | 🔎 Search Terms typescript 7.0.2 tsc noEmit out of memory typescript-go checker Relater recursiveTypeRelatedTo memory typescript 7 silent typecheck hang 🕗 Version & Regression Information The projec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Amatewasu |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width