Skip to content
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

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #3558

Closed
Suniron opened this issue Sep 13, 2023 · 6 comments

Comments

@Suniron
Copy link

Suniron commented Sep 13, 2023

On Windows 11 / WSL2 i got many crashes of Volar and error is about JavaScript heap out of memory

Please, not that I'm using vscode insiders but the rest of my team have the same problem and are on vscode classic.

I downgraded my typescript version from 5.2.2 to 5.1.3 since i have seen in the Volar changelog that it was supported a few versions ago.

When I haven't the error, the save code action is really long, and typing is not always refreshed in Vue files.

I installed Vue Langage Features (Volar) v1.8.11 (the problem is also present with 1.8.1 or 1.8.10 for example) and using it in take overmode, vue-tsc 1.8.11 .

I'm working on a monorepo with multiple apps and packages.

Please, see the full error bellow (i activated trace server: messages):

[Trace - 2:24:08 PM] Sending request 'textDocument/inlayHint - (711)'.
[Trace - 2:24:08 PM] Sending notification '$/cancelRequest'.
[Trace - 2:24:08 PM] Sending request 'textDocument/inlayHint - (712)'.
[Trace - 2:24:08 PM] Sending request 'textDocument/semanticTokens/range - (713)'.
[Trace - 2:24:09 PM] Sending request 'textDocument/hover - (714)'.
[Trace - 2:24:09 PM] Sending notification '$/cancelRequest'.

<--- Last few GCs --->

[193463:0x69f3dd0]   447569 ms: Scavenge 2027.2 (2079.5) -> 2023.2 (2081.3) MB, 7.2 / 0.0 ms  (average mu = 0.884, current mu = 0.527) allocation failure; 
[193463:0x69f3dd0]   447586 ms: Scavenge 2028.8 (2081.3) -> 2023.2 (2083.0) MB, 7.2 / 0.0 ms  (average mu = 0.884, current mu = 0.527) allocation failure; 
[193463:0x69f3dd0]   447607 ms: Scavenge 2030.8 (2083.0) -> 2023.8 (2099.0) MB, 7.8 / 0.0 ms  (average mu = 0.884, current mu = 0.527) allocation failure; 


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb7d990 node::Abort() [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 2: 0xa88a17  [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 3: 0xd76390 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 4: 0xd76737 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 5: 0xf540d5  [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 6: 0xf6654d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 7: 0xf40c9e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 8: 0xf42057 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
 9: 0xf234ba v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
10: 0x12ea97f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
11: 0x1727339  [/home/etienne/.vscode-server-insiders/bin/f36df69328ed10f76d4be03e8a82b61794b49711/node]
[Info  - 2:24:09 PM] Connection to server got closed. Server will restart.
true

I hope anyone can help us! 🙏 It's really hard to work with Volar in this state.

@andreasvirkus
Copy link

andreasvirkus commented Oct 16, 2023

Bump? 😕 This has become a constant blocker for our GitHub workflows

@Suniron
Copy link
Author

Suniron commented Oct 16, 2023 via email

@DelToney
Copy link

Check all your tsconfig files 👍

id love to know what im looking for in these ts files youre telling me to check. all of our ts files are properly configured and have not changed in the past month and im now running into this issue after upgrading to win 11.

I'm on a fresh install and currently am getting this behavior after 2 days of it working correctly (which was great while it lasted). the fact that it started being unable to function after a few days tell me that theres probably some missing clean up

@TheDutchCoder
Copy link

I just ran into this issue in Github workflows as well.
Any option to have this looked at?

@davidmatter
Copy link
Collaborator

Is this one still an issue in the latest 2.x?

@romansp
Copy link

romansp commented Aug 25, 2024

If someone else stumbles upon this issue.

We started seeing this quite randomly and only in our type-check runs during CI builds. No configuration changes or package upgrades, only merged a new feature with about 20-25 of new .vue files. Hard to pin-point what's the root cause to create a minimal repro.

We were on v2.0.29 of vue-tsc. Switching to #4714 via pkg.pr.new seems to help us for now.

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

No branches or pull requests

8 participants