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

[Extension/Formatting] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #1799

Open
ellaroosmarijn opened this issue Aug 17, 2024 · 0 comments

Comments

@ellaroosmarijn
Copy link

Bug description

Hello, I have a stock installation of [email protected] and an extension of the same version. My prisma schema file is in the usual place (prisma/schema.prisma). My VSCode settings are as recommended in this document.

When I attempt to format my schema.prisma file VSCode loads for around 30 seconds and the following is dumped to the VSCode output:

Stack trace (warning: long)
<--- Last few GCs --->

[56456:0x120009d0000]   386964 ms: Mark-Compact (reduce) 1928.2 (2071.0) -> 1662.0 (2070.0) MB, pooled: 0 MB, 2362.42 / 0.00 ms  (+ 7187.8 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 14601 ms) (average mu = 0[56456:0x120009d0000]   387001 ms: Scavenge (interleaved) 1663.0 (2070.0) -> 1662.5 (2073.0) MB, pooled: 0 MB, 6.83 / 0.00 ms  (average mu = 0.437, current mu = 0.418) allocation failure; 


<--- JS stacktrace --->

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

 1: 0x1192bebb0 node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 2: 0x113c45430 _$LT$font_types..tag..Tag$u20$as$u20$core..cmp..PartialEq$LT$$u5b$u8$u3b$$u20$4$u5d$$GT$$GT$::eq::h1cf26754fa042eb7 [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 3: 0x113c453c4 _$LT$font_types..tag..Tag$u20$as$u20$core..cmp..PartialEq$LT$$u5b$u8$u3b$$u20$4$u5d$$GT$$GT$::eq::h1cf26754fa042eb7 [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 4: 0x113e06104 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 5: 0x113e049e0 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 6: 0x113dfab80 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 7: 0x113ddd898 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 8: 0x1141cb3bc v8::internal::TickSample::print() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 9: 0x157ea9614 
10: 0x157e4c6dc 
11: 0x1500995d0 
12: 0x15009731c 
13: 0x157e4c8d4 
14: 0x157f1f578 
15: 0x157e3c184 
16: 0x157e0b598 
17: 0x113d5a098 v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
18: 0x113d5ad68 v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
19: 0x113d5aebc v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
20: 0x113d8496c v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
21: 0x1191ff7b0 node::CallbackScope::~CallbackScope() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
22: 0x1191ffb2c node::CallbackScope::~CallbackScope() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
23: 0x119214350 node::EmitAsyncDestroy(node::Environment*, node::async_context) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
24: 0x1192c776c node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
25: 0x1192c8054 node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
26: 0x1192b8130 node::Buffer::New(v8::Isolate*, char*, unsigned long) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
27: 0x112ab9938 uv_barrier_destroy [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
28: 0x112abcfd4 uv_async_send [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
29: 0x112acdb28 uv_free_interface_addresses [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
30: 0x112abd49c uv_run [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
31: 0x11920046c node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
32: 0x119201274 node::SpinEventLoop(node::Environment*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
33: 0x112ad21dc v8::ValueSerializer::Delegate::HasCustomHostObject(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
34: 0x112ace34c ElectronInitializeICUandStartNode [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
35: 0x19394a0e0 start [/usr/lib/dyld]
[Info  - 18:43:58] Connection to server got closed. Server will restart.
[Error - 18:43:58] Request textDocument/hover failed.
Error: Connection got disposed.
	at Object.dispose (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (node:events:531:35)
	at maybeClose (node:internal/child_process:1105:16)
	at ChildProcess._handle.onexit (node:internal/child_process:305:5)
[Error - 18:43:58] Request textDocument/hover failed.
Error: Connection got disposed.
	at Object.dispose (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/Users/me/.vscode/extensions/prisma.prisma-5.18.0/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (node:events:531:35)
	at maybeClose (node:internal/child_process:1105:16)
	at ChildProcess._handle.onexit (node:internal/child_process:305:5)
[Error - 18:43:58] Request textDocument/documentSymbol failed.

[[REMOVED 32 SIMILAR ERRORS]]

[Info  - 18:43:58] Default version of Prisma 'prisma-schema-wasm': 4c784e32044a8a016d99474bd02a3b6123742169
[Info  - 18:43:58] Extension name @prisma/language-server with version 5.18.0
[Info  - 18:43:58] Prisma Engines version: 5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169
[Info  - 18:43:58] Prisma CLI version: 5.18.0

<--- Last few GCs --->

[56646:0x114009d0000]   467804 ms: Scavenge (interleaved) 1762.2 (2067.8) -> 1760.6 (2067.8) MB, pooled: 0 MB, 5.42 / 0.00 ms  (average mu = 0.475, current mu = 0.469) allocation failure; 
[56646:0x114009d0000]   467816 ms: Scavenge (interleaved) 1763.5 (2067.8) -> 1761.7 (2075.8) MB, pooled: 0 MB, 4.67 / 0.00 ms  (average mu = 0.475, current mu = 0.469) allocation failure; 


<--- JS stacktrace --->

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

 1: 0x11b44ebb0 node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 2: 0x115dd5430 _$LT$font_types..tag..Tag$u20$as$u20$core..cmp..PartialEq$LT$$u5b$u8$u3b$$u20$4$u5d$$GT$$GT$::eq::h1cf26754fa042eb7 [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 3: 0x115dd53c4 _$LT$font_types..tag..Tag$u20$as$u20$core..cmp..PartialEq$LT$$u5b$u8$u3b$$u20$4$u5d$$GT$$GT$::eq::h1cf26754fa042eb7 [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 4: 0x115f96104 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 5: 0x115f949e0 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 6: 0x115f8ab80 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 7: 0x115f6d898 v8::CppHeap::wrapper_descriptor() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 8: 0x11635b3bc v8::internal::TickSample::print() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 9: 0x157ea9614 
10: 0x157e0d800 
11: 0x150198880 
12: 0x1501a5850 
13: 0x157e4c8d4 
14: 0x157f1f578 
15: 0x157e3c184 
16: 0x157e0b598 
17: 0x115eea098 v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
18: 0x115eead68 v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
19: 0x115eeaebc v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
20: 0x115f1496c v8::Unwinder::PCIsInV8(unsigned long, v8::MemoryRange const*, void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
21: 0x11b38f7b0 node::CallbackScope::~CallbackScope() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
22: 0x11b38fb2c node::CallbackScope::~CallbackScope() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
23: 0x11b3a4350 node::EmitAsyncDestroy(node::Environment*, node::async_context) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
24: 0x11b45776c node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
25: 0x11b4595f8 node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
26: 0x11b448130 node::Buffer::New(v8::Isolate*, char*, unsigned long) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
27: 0x114c49938 uv_barrier_destroy [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
28: 0x114c4cfd4 uv_async_send [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
29: 0x114c5db28 uv_free_interface_addresses [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
30: 0x114c4d49c uv_run [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
31: 0x11b39046c node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
32: 0x11b391274 node::SpinEventLoop(node::Environment*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
33: 0x114c621dc v8::ValueSerializer::Delegate::HasCustomHostObject(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
34: 0x114c5e34c ElectronInitializeICUandStartNode [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
35: 0x19394a0e0 start [/usr/lib/dyld]
[Info  - 18:51:47] Connection to server got closed. Server will restart.
[Info  - 18:51:47] Default version of Prisma 'prisma-schema-wasm': 4c784e32044a8a016d99474bd02a3b6123742169
[Info  - 18:51:47] Extension name @prisma/language-server with version 5.18.0
[Info  - 18:51:47] Prisma Engines version: 5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169
[Info  - 18:51:47] Prisma CLI version: 5.18.0

Finally, the document is not formatted.

How to reproduce

Not sure it's just happening... 😬 I've tried install and uninstalling VSCode and the extension several times, and have upgraded the prisma npm packages.

Expected behavior

It formats the document.

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model Event {
  id     Int      @id @default(autoincrement())
  name   String
  expiry DateTime @db.Date
  deleted_at    DateTime ?


}   

Environment & setup

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

No branches or pull requests

1 participant