language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

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

Open Suniron opened this issue 2 years ago β€’ 4 comments

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.

Suniron avatar Sep 13 '23 12:09 Suniron

Bump? πŸ˜• This has become a constant blocker for our GitHub workflows

andreasvirkus avatar Oct 16 '23 09:10 andreasvirkus

Check all your tsconfig files πŸ‘

Le lun. 16 oct. 2023, 11:27, andreas @.***> a Γ©crit :

Bump? πŸ˜•

β€” Reply to this email directly, view it on GitHub https://github.com/vuejs/language-tools/issues/3558#issuecomment-1764077890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIX2RDUO6XUKD4ADAUMKXHLX7T4Y5ANCNFSM6AAAAAA4WLW6ZY . You are receiving this because you authored the thread.Message ID: @.***>

Suniron avatar Oct 16 '23 09:10 Suniron

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

DelToney avatar Oct 17 '23 20:10 DelToney

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

TheDutchCoder avatar May 03 '24 20:05 TheDutchCoder

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

davidmatter avatar Aug 06 '24 06:08 davidmatter

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 https://github.com/vuejs/language-tools/pull/4714 via pkg.pr.new seems to help us for now.

romansp avatar Aug 25 '24 21:08 romansp