Skip to content

Angular Language Service extension crashes with “Out of heap memory” after large branch switch and cannot recover #65484

Closed

Description

@berg380

Description

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

  1. atscott commented on Nov 19, 2025

    @atscott
    Contributor

    Does this still happen with v21 of the extension? atscott@8c5a83b was an attempt to address this.

  2. added this to the needsTriage milestone on Nov 21, 2025
  3. atscott commented on Dec 6, 2025

    @atscott
    Contributor

    Closing as complete, hoping the above addressed the issue since we did not hear back either way.

  4. angular-automatic-lock-bot commented on Jan 6, 2026

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: vscode-extensionIssues related to the Angular Language Service VsCode extension

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions