Major
Major2mo ago

Deno language server no longer starting. "Fatal JavaScript out of memory: Reached heap limit" error

I'm encountering an issue wherein the deno language server keeps crashing for some reason and I can't seem to figure out why
9 Replies
Major
MajorOP2mo ago
[Info - 4:21:39 PM] Connection to server got closed. Server will restart.
Starting Deno language server...
version: 2.3.6 (release, x86_64-unknown-linux-gnu)
executable: /home/alexy/.deno/bin/deno
Connected to "Visual Studio Code" 1.100.2
Enabling import suggestions for: https://deno.land
Hit the language server document preload limit of 1000 file system entries. You may want to use the "deno.enablePaths" configuration setting to only have Deno partially enable a workspace or increase the limit via "deno.documentPreloadLimit". In cases where Deno ends up using too much memory, you may want to lower the limit.
Refreshing configuration tree...
Resolved Deno configuration file: "file:///home/alexy/qolloquia/deno.json"
Resolved lockfile: "file:///home/alexy/qolloquia/deno.lock"
TS server started.
Server ready.

<--- Last few GCs --->

[3127:0x7c030114f000] 11016 ms: Scavenge 3060.4 (3072.1) -> 3060.2 (3075.3) MB, pooled: 0.0 MB, 3.03 / 0.00 ms (average mu = 0.773, current mu = 0.427) allocation failure;
[3127:0x7c030114f000] 11293 ms: Mark-Compact (reduce) 3068.9 (3081.8) -> 3067.8 (3076.8) MB, pooled: 0.0 MB, 202.59 / 0.00 ms (+ 22.8 ms in 116 steps since start of marking, biggest step 5.0 ms, walltime since start of marking 277 ms) (average mu = 0.6
[Info - 4:21:39 PM] Connection to server got closed. Server will restart.
Starting Deno language server...
version: 2.3.6 (release, x86_64-unknown-linux-gnu)
executable: /home/alexy/.deno/bin/deno
Connected to "Visual Studio Code" 1.100.2
Enabling import suggestions for: https://deno.land
Hit the language server document preload limit of 1000 file system entries. You may want to use the "deno.enablePaths" configuration setting to only have Deno partially enable a workspace or increase the limit via "deno.documentPreloadLimit". In cases where Deno ends up using too much memory, you may want to lower the limit.
Refreshing configuration tree...
Resolved Deno configuration file: "file:///home/alexy/qolloquia/deno.json"
Resolved lockfile: "file:///home/alexy/qolloquia/deno.lock"
TS server started.
Server ready.

<--- Last few GCs --->

[3127:0x7c030114f000] 11016 ms: Scavenge 3060.4 (3072.1) -> 3060.2 (3075.3) MB, pooled: 0.0 MB, 3.03 / 0.00 ms (average mu = 0.773, current mu = 0.427) allocation failure;
[3127:0x7c030114f000] 11293 ms: Mark-Compact (reduce) 3068.9 (3081.8) -> 3067.8 (3076.8) MB, pooled: 0.0 MB, 202.59 / 0.00 ms (+ 22.8 ms in 116 steps since start of marking, biggest step 5.0 ms, walltime since start of marking 277 ms) (average mu = 0.6
#
# Fatal JavaScript out of memory: Reached heap limit
#
==== C stack trace ===============================

/home/alexy/.deno/bin/deno(+0x28af603) [0x581a630c1603]
/home/alexy/.deno/bin/deno(+0x28ae67b) [0x581a630c067b]
/home/alexy/.deno/bin/deno(+0x28b2738) [0x581a630c4738]
/home/alexy/.deno/bin/deno(+0x2907846) [0x581a63119846]
/home/alexy/.deno/bin/deno(+0x2af0417) [0x581a63302417]
/home/alexy/.deno/bin/deno(+0x2aee324) [0x581a63300324]
/home/alexy/.deno/bin/deno(+0x2ae2b7c) [0x581a632f4b7c]
/home/alexy/.deno/bin/deno(+0x2ac593a) [0x581a632d793a]
/home/alexy/.deno/bin/deno(+0x2fb3488) [0x581a637c5488]
[0x7c02ffe76b36]
[Error - 4:22:10 PM] The Deno Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
#
# Fatal JavaScript out of memory: Reached heap limit
#
==== C stack trace ===============================

/home/alexy/.deno/bin/deno(+0x28af603) [0x581a630c1603]
/home/alexy/.deno/bin/deno(+0x28ae67b) [0x581a630c067b]
/home/alexy/.deno/bin/deno(+0x28b2738) [0x581a630c4738]
/home/alexy/.deno/bin/deno(+0x2907846) [0x581a63119846]
/home/alexy/.deno/bin/deno(+0x2af0417) [0x581a63302417]
/home/alexy/.deno/bin/deno(+0x2aee324) [0x581a63300324]
/home/alexy/.deno/bin/deno(+0x2ae2b7c) [0x581a632f4b7c]
/home/alexy/.deno/bin/deno(+0x2ac593a) [0x581a632d793a]
/home/alexy/.deno/bin/deno(+0x2fb3488) [0x581a637c5488]
[0x7c02ffe76b36]
[Error - 4:22:10 PM] The Deno Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
Leokuma
Leokuma2mo ago
Is your project publicly available so that we can reproduce the error?
bartlomieju
bartlomieju2mo ago
The server is probably loading too much code running out of available memory - you can try excluding some directories with deno.excludePaths setting
nathanwhit
nathanwhit2mo ago
I checked it out. It seems like something is up with that canary version of zod you're using. It's causing the typescript compiler to run out of memory while trying to check types. I tried with the normal TS server as well and it also crashed with OOM. Switching to latest released version of zod (non canary) seems to work fine
Major
MajorOP2mo ago
Sorry unfortunately it isn't :(
Pawie
Pawie2mo ago
@nathanwhit out of curiosity and for my learning, how do you tell that a canary version of zod is used based on just those traces?
nathanwhit
nathanwhit2mo ago
Ah sorry, I thought this was the same as https://github.com/denoland/deno/issues/29881. I see now it’s a different issue, my bad!
GitHub
denoland/deno
A modern runtime for JavaScript and TypeScript. Contribute to denoland/deno development by creating an account on GitHub.
Pawie
Pawie2mo ago
No, that makes perfect sense! We do use zod and currently using zod/v4, so it's possible that it's related! I thought there is away to tell in those traces that I'm no aware of and was super curious! 😆 Maybe another data point for you: I'm on 2.3.7, macOS Sequoia 15.5, VS Code 1.101.1 and my Deno language has been fine with zod/v4.
Major
MajorOP2mo ago
Hello! Just to update, I have found a temporary fix by just lowering deno.documentPreloadLimit in vscode!

Did you find this page helpful?