-
Notifications
You must be signed in to change notification settings - Fork 335
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
Support specify --max-old-space-size for started server #733
Comments
@singleghost this can currently not be controlled. What are you linting that 1 GB of memory is not enough. The server only validates the open files so that should be usually not be more than a handful? |
Actually I open hundreds of file in vscode at same time. Just because using eslint in the vscode is convenient than using it in the command line 😄 . It would be helpful If can specify the argument for starting server. |
There is also a lint task in VS Code that you can use to lint all the files without the need to open them. To enable the task use |
I have tried that task but it dumps it output to the integrated terminal not the problem panel. In the problem panel, I can easily jump to the desired position in the file but I can't do this in the integrated terminal. |
It does both. It dumps the output to the terminal and captures problems from it that appear in the problems view. Doesn't that work for you? |
Oh! It does dumps the output to the problems panel. However, I still cannot pass --max-old-space-size to it because it is a node argument. |
How to you pass |
like |
OK. Makes sense |
I get this sometimes as well if eslint is enabled and I open a directory without an eslintrc file, but am using the working directories option. I setup an ignore at the root and it seems to have helped. |
Yes, set a ignore would help. But I need eslint to lint large numbers of files at a time in vscode. |
Completely agree. |
Facing a similar issue with a similar error log as given in the issue description: Normally, I run |
@maneetgoyal Totally agree! |
I hit this problem constantly, and I believe it's because I use typescript-eslint which uses quite a lot of memory to gather type information for the project (as it needs to compile the whole project). Is microsoft/vscode-languageserver-node#467 something you'd like to fix and rely on for this issue? What approach would you recommend for implementing this? |
I've ended up using the #!/bin/bash
echo "ESLint server using Node.js from: $0"
export NODE_OPTIONS=--max_old_space_size=4096
echo "ESLint server using NODE_OPTIONS: $NODE_OPTIONS"
node $@
|
It is a nice approach to work around this. |
@bradleyayers @singleghost Can you please add some more details? I think I'm doing something wrong. Currently, I have this in my Using absolute path for the bash script seemed to work, after |
with this approach, I can't seem to get it to use the node version that the project is using. I tried setting vscode eslint runtime, setting default node version for nvm, opening code through command line. anyone able to get this to use the node version you want? |
ok, update, if I |
I have big trouble with this problem. |
Added setting |
For anyone confused as to why See: |
Hi @bradleyayers @dbaeumer , is there any documentation on how I can use |
They are the same as normal node command line options. |
thanks for the answer @dbaeumer
|
Nevermind, I configured the wrong |
Why does this feature not help me? Process explorer shows that eslint server is started by anover code process, which reads eslint.execArgv parameter and command line looks like this: but still VSCode ESLint OUTPUT shows OOM exceptions at 4Gb bounday: [3344:000015FA002EC000] 180755 ms: Scavenge 3960.5 (4058.1) -> 3960.3 (4058.1) MB, 55.6 / 0.0 ms (average mu = 0.881, current mu = 0.581) allocation failure; <--- JS stacktrace ---> FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory |
@vlad2135 same here! just verified process should have the arg:
but running out of memory right at 4gb still! @dbaeumer any ideas? the setting is
|
Actually now. Have you tried with a pure node runtime (e.g. using |
fyi i believe it's this: https://stackoverflow.com/questions/69581598/after-upgrading-electron-from-1-to-10-the-max-old-space-size-command-cant-se i confirmed that setting this to 1024 is reflected (and crashes very quickly lol). So the max at 4g seems to be this pointer compression thing. Enabling a pure |
@scamden thanks for the pointer. I wasn't aware of that. So the recommendation is to use a pure node runtime if you need a larger heap. |
Thank you for the advice, it worked! |
When I use eslint plugin in VSCode to lint a large bunch of files, the eslint server crashes. I try to find some way to add node options like "--max-old-space-size=4096", "--stack_size=10000" to start eslint server but failed.
crash message
Eslint version: 1.9.0
Vscode version: 1.37.0-insider
The text was updated successfully, but these errors were encountered: