⚡ Sangsakala Proxy 🏠 Home
Skip to content

JS: Remove TypeScript parser memory limits - #22991

Open
paldepind wants to merge 1 commit into
mainfrom
js/remove-memory-limit
Open

paldepind wants to merge 1 commit into
mainfrom
js/remove-memory-limit

Conversation

@paldepind

@paldepind paldepind commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Remove memory limits imposed on the NodeJS process by the Java process. Rationale copy/pasted from the internal issue:

  • The NodeJS thread only does parsing whereas previously it also did type checking. The latter can use a lot of memory, but I'm not worried about parsing using a lot of memory.
  • When we update to TypeScript 7.1 the real work will be done by a new thread corresponding to the Go thread. Enforcing the limits is then going to be harder, instead we should just remove them.

This also removes the CODEQL_RAM/2 memory limit on the Java process. I took a look, and the only other extractor that uses CODEQL_RAM is the Java extractor. So I think ignoring that here is perfectly fine.

@github-actions github-actions Bot added the JS label Nov 3, 2026
@paldepind
paldepind force-pushed the js/remove-memory-limit branch from e880006 to 9cedbce Compare November 3, 2026 10:24
Remove extractor-imposed Node heap limits and obsolete TypeScript RAM
configuration. Stop interpreting `CODEQL_RAM` in the JavaScript
autobuild launchers, but retain `--typescript-ram` as an ignored
compatibility option.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7f45b794-38b9-4abc-b652-03279c8dba77
@paldepind
paldepind force-pushed the js/remove-memory-limit branch from 9cedbce to ac7cb39 Compare November 3, 2026 10:25
@paldepind
paldepind marked this pull request as ready for review November 3, 2026 10:26
Copilot AI auto review requested due to automatic review settings November 3, 2026 10:26
@paldepind
paldepind requested review from a team as code owners November 3, 2026 10:26

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded for the extractor memory-limit changes.

No open issues 🎉

What changed in this PR

Removes extractor-imposed memory limits for JavaScript and TypeScript extraction, reflecting the TypeScript process’s reduced role of parsing without type checking.

Changes:

  • Removes the Node.js heap-limit override and associated TypeScript memory configuration.
  • Stops splitting CODEQL_RAM between Java and Node.js in both autobuild scripts.
  • Keeps --typescript-ram accepted as a deprecated, ignored option.
File Description
javascript/​resources/​tools/​autobuild.sh Removes RAM splitting and the Java heap override on Unix.
javascript/​resources/​tools/​autobuild.cmd Removes equivalent memory configuration on Windows.
javascript/​extractor/​src/​com/​semmle/​ts/​extractor/​TypeScriptParser.java Removes RAM settings and the explicit Node.js heap limit.
javascript/​extractor/​src/​com/​semmle/​js/​extractor/​Main.java Accepts but ignores the deprecated --typescript-ram option.
javascript/​extractor/​src/​com/​semmle/​js/​extractor/​ExtractorConfig.java Removes the TypeScript RAM field and accessors.

Review effort: Balanced (auto)

@paldepind paldepind changed the title JavaScript: Remove TypeScript parser memory limits JS: Remove TypeScript parser memory limits Nov 3, 2026
@asgerf

asgerf commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

I'd like to wait for the QA run before merging this.

In any case I'm not sure I see the need for this change tbh. These flags exist because Node and Java have a self-enforced max heap limit which need to be high enough. Why rely on the default value being high enough?

Go doesn't have such a limit and we wouldn't need to set anything similar for the Go subprocess. It's not a "hard to enforce limit" it's more like "this problem doesn't exist for Go".

@paldepind

Copy link
Copy Markdown
Contributor Author

Thanks @asgerf. Perhaps I was focusing too much on the comment saying:

Sets the amount of RAM to allocate to the TypeScript compiler.

If we wanted to implement the limit like stated there, then it would be hard, because most of that RAM is now used in the Go process.

But I see your point. Perhaps, instead of this PR, we should just change the comments and docs to make it clear that it's about setting the memory limit for the NodeJS process and not the TypeScript compiler?

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants