Skip to content

Increased stack-size #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@typescript/server-replay",
"author": "Microsoft Corp.",
"homepage": "https://github.com/microsoft/typescript-server-replay#readme",
"version": "0.2.12",
"version": "0.2.13",
"license": "MIT",
"description": "Replay server requests from a file",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions replay.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ async function main() {
const nodeArgs = [
"--max-old-space-size=4096",
"--expose-gc",
"--stack-size=2048",
Copy link
Member

Choose a reason for hiding this comment

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

I might be wrong but I thought this was already the default for Node?

Copy link
Author

Choose a reason for hiding this comment

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

The default is 984kB and I think is half of that if you're on 32bit. On PowerShell, you can see by running the command:

node --v8-options | Select-String -Pattern "stack-size" -Context 0,1

Copy link
Author

Choose a reason for hiding this comment

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

>   --stack-size (default size of stack region v8 is allowed to use (in kBytes))
>         type: int  default: --stack-size=984

Copy link
Member

Choose a reason for hiding this comment

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

Hm, I checked VS Code and it told me that was still the default:

  --stack-size (default size of stack region v8 is allowed to use (in kBytes))
        type: int  default: --stack-size=984

(Set $env:ELECTRON_RUN_AS_NODE=1 and then:

& "C:\Users\jabaile\AppData\Local\Programs\Microsoft VS Code\Code.exe" --v8-options | Select-String -Pattern "stack-size" -Context 0,1

>   --maglev-assert-stack-size (insert stack size checks before every IR node)
>         type: bool  default: --maglev-assert-stack-size
    --maglev-break-on-entry (insert an int3 on maglev entries)
>   --wasm-stack-switching-stack-size (default size of stacks for wasm stack-switching (in kB))
>         type: int  default: --wasm-stack-switching-stack-size=984
    --liftoff (enable Liftoff, the baseline compiler for WebAssembly)
>   --stack-size (default size of stack region v8 is allowed to use (in kBytes))
>         type: int  default: --stack-size=984
    --max-stack-trace-source-length (maximum length of function source code printed in a stack trace.)

Copy link
Author

Choose a reason for hiding this comment

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

Interesting, I don't know much about the ELECTRON_RUN_AS_NODE flag but seems like is avoiding running the electron environment. Could that be a difference?

Do you know of another method that caused the stack trace to be processed on VSCode better?

// "--require=E:/tsserver-stress/node_modules/pprof-it/dist/index.js",
];

Expand Down