Skip to content

[Bug]: Language server crashes with OOM (JavaScript heap out of memory) on high-RAM machines due to over-allocated max-old-space-size #138

Description

@dariuscooper1987

Current Behavior

On high-RAM systems (e.g., 64 GB RAM), the IDL extension automatically assigns an excessively large value to --max-old-space-size (e.g., --max-old-space-size=49152) when spawning the Node.js Language Server process.

This causes the V8 engine to hit integer overflow / memory limit defense mechanisms, triggering a fallback to default memory limits (~256–512 MB). As a result, when performing operations like Document Symbol Request or formatting on larger .pro files, the Language Server frequently crashes with a JavaScript heap out of memory error (Error Code 134).

<--- Last few GCs --->
[22540:0000792001AC0000]  3063984 ms: Mark-Compact (reduce) 291.4 (311.7) -> 291.4 (293.7) MB ... last resort; GC in old space requested
[22540:0000792001AC0000]  3064082 ms: Mark-Compact (reduce) 291.4 (293.7) -> 291.4 (292.5) MB ... last resort; GC in old space requested

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

[Error] Server process exited with code 134.
idl-client error The connection to the IDL Language Server unexpectedly closed

These are the original default parameters.
Image

These are my modified parameters, and everything works perfectly now.
The modified file is "C:\Users\xxxxx.vscode\extensions\idl.idl-for-vscode-6.2.2\dist\apps\vscode\client\main.js".
Image

Expected Behavior

Cap the automatically calculated --max-old-space-size to a safe maximum (e.g., 8192 or 10240 MB) instead of scaling it linearly based on system physical memory, or expose a configuration option (such as idl.developer.nodeFlags) so users can override Node.js CLI arguments manually.

GitHub Repo

No response

Steps to Reproduce

  1. formatting on larger .pro files

Failure Logs

Operating System

  • macOS (Intel x86_64)
  • macOS (ARM64)
  • Linux
  • Windows

IDL Version

IDL 9.3

Additional Information

Extension Version: v6.2.2 (IDL for VSCode)
OS: Windows 11 (64-bit)
System RAM: 64 GB

Activity

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

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions