Skip to content

fix(cloudformation): Cap CloudFormation LSP server heap at 384MB - #8837

Open
chrisqm-dev wants to merge 1 commit into
aws:masterfrom
chrisqm-dev:perf/cfn-lsp-memory-limits
Open

fix(cloudformation): Cap CloudFormation LSP server heap at 384MB#8837
chrisqm-dev wants to merge 1 commit into
aws:masterfrom
chrisqm-dev:perf/cfn-lsp-memory-limits

Conversation

@chrisqm-dev

Copy link
Copy Markdown
Contributor

Set NODE_OPTIONS --max-old-space-size=384 when spawning the CloudFormation language server process. Without this, V8 uses its default ~4GB ceiling and the process grows unbounded

This is to partially address memory consumption issues of the language server: aws/aws-toolkit-jetbrains#6380

The original issue was for jetbrains but it is applicable to the vscode client as well.

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@chrisqm-dev
chrisqm-dev requested a review from a team July 23, 2026 14:25
@amazon-inspector-ohio

Copy link
Copy Markdown

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@github-actions

Copy link
Copy Markdown
  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@chrisqm-dev chrisqm-dev changed the title perf: Cap CloudFormation LSP server heap at 384MB feat(cloudformation): Cap CloudFormation LSP server heap at 384MB Jul 23, 2026
@chrisqm-dev chrisqm-dev changed the title feat(cloudformation): Cap CloudFormation LSP server heap at 384MB fix(cloudformation): Cap CloudFormation LSP server heap at 384MB Jul 23, 2026
@amazon-inspector-ohio

Copy link
Copy Markdown

✅ I finished the code review, and didn't find any security or code quality issues.

Set NODE_OPTIONS --max-old-space-size=384 when spawning the
CloudFormation language server process. Without this, V8 uses its
default ~4GB ceiling and the process grows unbounded — field data
shows the server's main heap runs 100–200MB so 384MB gives ~2x
headroom while preventing runaway growth from consuming the IDE's
memory budget.

Complements cloudformation-languageserver server-side optimizations
(cfn-lint-disabled early exit, worker thread heap caps, orphan
process fix).

aws/aws-toolkit-jetbrains#6380
@chrisqm-dev
chrisqm-dev force-pushed the perf/cfn-lsp-memory-limits branch from ae4e848 to 949222b Compare July 23, 2026 14:28
@github-actions

Copy link
Copy Markdown
  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.


const envOptions = {
NODE_OPTIONS: '--enable-source-maps',
NODE_OPTIONS: '--enable-source-maps --max-old-space-size=384',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 384?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is --enable-source-maps support to help with the memory issue?

@satyakigh satyakigh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change needs to be validated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants