-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Linux ARM : --max-old-space-size flag not working as expected #55763
Comments
Are you sure this isn't a bug with VSCode? It's possible their code needs more memory than your allowing it to access |
@RedYetiDev : The same flag is working with 3000mb on my Mac. |
Can you reproduce outside of VSCode? |
@RedYetiDev : I don't have another project who require that amount of ram. |
IMO there's a good change that VSCode requires more memory than you're allowing it to have. Despite it working on MacOS, it's possible the memory management of the two systems is much different. I'm happy to get a second opinion on this tho. |
How are you setting max-old-space-size? In general, each app has a memory "working set" that may depend on the platform configuration, and the max old space size needs to be configured to be larger than the working set size, or the app crashes. By default, the max old space size is configured based on the memory limit. What is the memory limit in your case? |
I am modifying the 3 values of the package.json, I have used 20.18.0, and I also updated to 22.11.0 to check this was not an old version problem solved since, both worked on macOS, both is crashing on Linux.
What I understand, is that there is a memory sweet-spot to find. |
137 means node was killed by a SIGKILL signal, probably OOM-killed by the kernel. Check dmesg and lower --max-old-space-size. You're trying to use more memory than the system will let you. Local issue, not a bug. Closing. |
@bnoordhuis : MacOS Arm : task work with 2048mo The instructions are the same. Why linux is crashing ? |
You misunderstand. You instruct node to use up to 3 GB but linux won't let you. |
Why ? And why the same task is working with MacOS ? |
@jcommaret if unspecified, nodejs/v8 configures max-old-space based on the memory limit. For example, with a 2g memory limit, max old space is set to 1g by default. The nodejs docs state that you might want to adjust this. For example, if you're only running one process in 2g memory then you might want to set max old space to 1536 in order to use more of the available memory. For example, below is node:20 running with a memory limit of 2g and max old space of 1536mb: docker run -it -m 2g \
-e NODE_OPTIONS="--max-old-space-size=1536" \
node:20 node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))' However, it does not make sense for you to set max old space (or create an issue) unless you know what the memory limit is. |
ok, let's remove the --max-old-space flag. |
I removed the Mac OS is working with 2048 mo. Don't understand why there is such a difference. Let's try on Linux x86 |
Version
v22.11.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Sorry, but the bug needs a large amount of code to crash, so here is what i did :
Clone Microsoft visual studio code repo :
git clone [email protected]:microsoft/vscode.git
cd vscode
--max-old-space-size
to a lower amount of RAM (3000 in my case)npm install
npm run watch
How often does it reproduce? Is there a required condition?
Allways reproducing
What is the expected behavior? Why is that the expected behavior?
The code should not kill nodejs with error 137, because this is an Out of memory error, but the setup is made to take in account there is only 3000.
I was able to have the same code working on macOS ARM with lower ram configuration (3000 RAM)
What do you see instead?
error 137
Additional information
I wonder if there is no security issue about that.
--max-old-space-size
flag have impact on memory management.Here is the conversation with Microsoft VSCode Team, when i told them this command should work
microsoft/vscode#232535
The text was updated successfully, but these errors were encountered: