You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular Language Service extension crashes with “Out of heap memory” after large branch switch and cannot recover #65484
When switching Git branches with several thousand file differences (>5000) in a medium-to-large Angular monorepo (~2600 .ts, ~1000 .html files), the Angular Language Service (ALS) extension frequently crashes with an “Out of heap memory” error.
This happens even on machines with plenty of RAM.
Repeated branch switches (without restarting VS Code) seem to exacerbate the issue.
After the ALS extension crashes, it is unable to recover automatically — it gets stuck in an endless “Initializing Angular language features” loop and no longer performs template type checking until the user manually restarts VS Code or uses Reload Window.
When not switching branches, ALS operates normally and stabilizes at around 2.7 GB of memory with ~100 HTML files open from different libraries.
We greatly appreciate the template type checking provided by the ALS extension — this is the only issue interrupting otherwise smooth operation.
System and project information
OS: Windows 11 (x64)
VS Code: 1.xx.x (x64)
Node.js: 20.12.1 (x64)
TypeScript: 5.4.5
Angular: 18.2.8
Angular Language Service: 18.2.8
Angular Language Service Extension: 18.2.0
Angular Language Service Extension dependencies: ALS v18.2.0-rc.0, TS v5.5.3
Project context
Monorepo with 8 libraries, 4 containing most of the templates.
Desired (workaround) solution
A way to increase the heap size for the ALS extension process beyond the 4096 MB limit
Desired solution
The ALS extension handles memory spikes during large branch switches without exceeding the heap limit or accumulating memory with each branch change.
The ALS extension can recover automatically after an “Out of heap memory” error, without requiring a VS Code restart or Reload Window.
Activity
fix(language-service): address potential memory leak during project c…
fix(language-service): address potential memory leak during project c…
fix(language-service): address potential memory leak during project c…
fix(language-service): address potential memory leak during project c…
atscott commentedon Nov 19, 2025
Does this still happen with v21 of the extension? atscott@8c5a83b was an attempt to address this.
atscott commentedon Dec 6, 2025
Closing as complete, hoping the above addressed the issue since we did not hear back either way.
angular-automatic-lock-bot commentedon Jan 6, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.