vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

Frequent hangs, CPU spikes in LSP

Open cknight opened this issue 9 months ago • 75 comments

Possibly related to https://github.com/denoland/deno/issues/20136

Recently I'm having frequent CPU spikes and the LSP hangs preventing me from interacting with the editor which is highly frustrating.

Output

Starting Deno language server...
  version: 1.37.0 (release, x86_64-unknown-linux-gnu)
  executable: /home/chris/.deno/bin/deno
Connected to "Visual Studio Code" 1.82.2
  Auto-resolved configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Setting import map defined in configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
  Resolved import map: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Enabling import suggestions for: https://deno.land
Download https://deno.land/.well-known/deno-import-intellisense.json
shutdown request received, shutting down
Starting Deno language server...
  version: 1.37.0 (release, x86_64-unknown-linux-gnu)
  executable: /home/chris/.deno/bin/deno
Connected to "Visual Studio Code" 1.82.2
  Auto-resolved configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Setting import map defined in configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
  Resolved import map: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Enabling import suggestions for: https://deno.land
exit notification received, stopping
Server ready.
client asked to cancel request 11, but no such pending request exists, ignoring
client asked to cancel request 12, but no such pending request exists, ignoring
client asked to cancel request 3, but no such pending request exists, ignoring
client asked to cancel request 4, but no such pending request exists, ignoring
client asked to cancel request 1, but no such pending request exists, ignoring
client asked to cancel request 2, but no such pending request exists, ignoring
successfully cancelled request with ID: 21
successfully cancelled request with ID: 22
client asked to cancel request 19, but no such pending request exists, ignoring
client asked to cancel request 20, but no such pending request exists, ignoring
successfully cancelled request with ID: 23
successfully cancelled request with ID: 24
successfully cancelled request with ID: 27
successfully cancelled request with ID: 28
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
client asked to cancel request 29, but no such pending request exists, ignoring
client asked to cancel request 30, but no such pending request exists, ignoring
successfully cancelled request with ID: 35
successfully cancelled request with ID: 36
successfully cancelled request with ID: 37
successfully cancelled request with ID: 38
successfully cancelled request with ID: 43
successfully cancelled request with ID: 44
successfully cancelled request with ID: 45
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
successfully cancelled request with ID: 42
client asked to cancel request 34, but no such pending request exists, ignoring
successfully cancelled request with ID: 48
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
client asked to cancel request 47, but no such pending request exists, ignoring
Unable to send result to client.
successfully cancelled request with ID: 52
Unable to send result to client.
successfully cancelled request with ID: 66
Unable to send result to client.

The editor will hang and eventually spit out a number of output lines, sometimes 2 ("successfully..." and "Unable...") sometimes more.

Versions

vscode: 1.82.2 deno: 1.37.0 extension: occurs on both the latest 3.24.0 and the previous version (3.23.1?) os: Linux Mint 21

cknight avatar Sep 26 '23 16:09 cknight

After a recent hang (from a stable state, all I did was press Ctrl-W twice to select all text within a pair of quotes), all this output came at once after the editor became responsive again:

successfully cancelled request with ID: 241
client asked to cancel request 242, but no such pending request exists, ignoring
Unable to send result to client.
client asked to cancel request 246, but no such pending request exists, ignoring
client asked to cancel request 243, but no such pending request exists, ignoring
successfully cancelled request with ID: 248
client asked to cancel request 249, but no such pending request exists, ignoring
client asked to cancel request 247, but no such pending request exists, ignoring
client asked to cancel request 250, but no such pending request exists, ignoring
Unable to send result to client.
client asked to cancel request 251, but no such pending request exists, ignoring
client asked to cancel request 252, but no such pending request exists, ignoring
client asked to cancel request 253, but no such pending request exists, ignoring
client asked to cancel request 255, but no such pending request exists, ignoring
client asked to cancel request 254, but no such pending request exists, ignoring
client asked to cancel request 256, but no such pending request exists, ignoring
client asked to cancel request 257, but no such pending request exists, ignoring
successfully cancelled request with ID: 260
successfully cancelled request with ID: 261
successfully cancelled request with ID: 262
Unable to send result to client.
client asked to cancel request 258, but no such pending request exists, ignoring
Unable to send result to client.
client asked to cancel request 245, but no such pending request exists, ignoring
successfully cancelled request with ID: 266
successfully cancelled request with ID: 269
client asked to cancel request 263, but no such pending request exists, ignoring
client asked to cancel request 264, but no such pending request exists, ignoring
successfully cancelled request with ID: 270
client asked to cancel request 265, but no such pending request exists, ignoring
Unable to send result to client.
Unable to send result to client.
client asked to cancel request 267, but no such pending request exists, ignoring
successfully cancelled request with ID: 274
client asked to cancel request 271, but no such pending request exists, ignoring
client asked to cancel request 259, but no such pending request exists, ignoring
client asked to cancel request 272, but no such pending request exists, ignoring
client asked to cancel request 273, but no such pending request exists, ignoring
Unable to send result to client.
client asked to cancel request 275, but no such pending request exists, ignoring
client asked to cancel request 268, but no such pending request exists, ignoring
client asked to cancel request 278, but no such pending request exists, ignoring
successfully cancelled request with ID: 283
successfully cancelled request with ID: 284
successfully cancelled request with ID: 288
Unable to send result to client.
Unable to send result to client.
client asked to cancel request 287, but no such pending request exists, ignoring
Unable to send result to client.
successfully cancelled request with ID: 291
successfully cancelled request with ID: 293
successfully cancelled request with ID: 294
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.

cknight avatar Sep 26 '23 16:09 cknight

image

cknight avatar Sep 26 '23 16:09 cknight

Downgrading to Deno 1.36.0 did not resolve the situation. Disabling the LSP stopped the hangs and CPU spikes (obviously not a solution)

cknight avatar Sep 26 '23 16:09 cknight

Same here on Win 11. Renaming or moving a file causes LSP to hang for quite some time, then pops up an error about OOM, and shutting down! I've seen the same list of messages as above.

This is an inexpensive HP laptop with non-upgradable 8Gig memory. Started happening when Deno Upgrade to v1.37.0.

Also the laptop fan gets very load when this happens! I've never heard the fan on this new machine prior to this.

deno 1.37.0 (release, x86_64-pc-windows-msvc) v8 11.8.172.3 typescript 5.2.2

nhrones avatar Sep 26 '23 17:09 nhrones

Downgraded to Deno 1.33.0, still hangs

cknight avatar Sep 26 '23 17:09 cknight

If this is an LSP issue, would a Deno extension downgrade help?

nhrones avatar Sep 26 '23 17:09 nhrones

It would if there was a bad interaction or issue with, say, the formatter or linter. I'll try downgrading the extension later tonight if that's possible.

cknight avatar Sep 26 '23 17:09 cknight

In order to experience Bun, had installed WSL and the WSL extension in VS Code. I realize now that It was only after that that my LSP failures started. I suggest that WSL is a resource pig. No more LSP issues noticed now that I've removed WSL. I still wonder why LSP requires so much memory?

nhrones avatar Sep 26 '23 21:09 nhrones

After removal of WSL I still have an issue! Renaming an 8.2mb file took more than 10 seconds. The IDE was unusable during this time. No crash or OOM was reported, but why would a file rename take such a long time?

nhrones avatar Sep 26 '23 21:09 nhrones

image

This popup is open for more than 15 seconds on any filename change.
Is this normal?

nhrones avatar Sep 26 '23 21:09 nhrones

Downgraded the extension to 3.22.0 and am still experiencing the issue..

cknight avatar Sep 26 '23 21:09 cknight

After removal of WSL I still have an issue! Renaming an 8.2mb file took more than 10 seconds. The IDE was unusable during this time. No crash or OOM was reported, but why would a file rename take such a long time?

On rename attemps the language server asks the embedded ts server to look for imports that it can rename. I guess that's taking a really long time.

Do either of you have any large dependencies that I can try to reproduce this with? I think the large TS module graph that tsc has to work with in a Deno project might be a factor.

nayeemrmn avatar Sep 26 '23 21:09 nayeemrmn

Do either of you have any large dependencies that I can try to reproduce this with? I think the large TS module graph that tsc has to work with in a Deno project might be a factor.

I'm working on a new'ish Fresh project, not very far into it, and I don't think I have any large dependencies. I've pushed my WIP code here if it helps: https://github.com/cknight/kv-explorer

cknight avatar Sep 26 '23 21:09 cknight

I've rebooted. The LSP crashed on launch of VS Code. Restarted VS Code, and it was stable for a bit (as in I could actually use the LSP for now), though now it's hanging again. Found a new error in the Output, though I got this one during a period where the LSP wasn't hanging:

Unable to get completion info from TypeScript: Error: Debug Failure. Some exportInfo should match the specified exportMapKey
    at Object.getImportCompletionAction (ext:deno_tsc/00_typescript.js:149303:13)
    at getCompletionEntryCodeActionsAndSourceDisplay (ext:deno_tsc/00_typescript.js:158366:64)
    at Object.getCompletionEntryDetails (ext:deno_tsc/00_typescript.js:158229:48)
    at Object.getCompletionEntryDetails2 [as getCompletionEntryDetails] (ext:deno_tsc/00_typescript.js:142313:37)
    at serverRequest (ext:deno_tsc/99_main_compiler.js:1100:27)
    at [ext:cli/lsp/tsc.rs:4179:26]:1:12
Further Output which appeared on first hang after reboot
client asked to cancel request 1254, but no such pending request exists, ignoring
client asked to cancel request 1255, but no such pending request exists, ignoring
client asked to cancel request 1256, but no such pending request exists, ignoring
client asked to cancel request 1265, but no such pending request exists, ignoring
client asked to cancel request 1266, but no such pending request exists, ignoring
client asked to cancel request 1267, but no such pending request exists, ignoring
successfully cancelled request with ID: 1270
Unable to send result to client.
successfully cancelled request with ID: 1271
Unable to send result to client.
successfully cancelled request with ID: 1309
successfully cancelled request with ID: 1310
successfully cancelled request with ID: 1311
successfully cancelled request with ID: 1312
successfully cancelled request with ID: 1313
successfully cancelled request with ID: 1315
successfully cancelled request with ID: 1316
successfully cancelled request with ID: 1317
successfully cancelled request with ID: 1318
successfully cancelled request with ID: 1319
successfully cancelled request with ID: 1321
successfully cancelled request with ID: 1320
successfully cancelled request with ID: 1322
successfully cancelled request with ID: 1323
client asked to cancel request 1299, but no such pending request exists, ignoring
client asked to cancel request 1300, but no such pending request exists, ignoring
client asked to cancel request 1301, but no such pending request exists, ignoring
client asked to cancel request 1302, but no such pending request exists, ignoring
client asked to cancel request 1303, but no such pending request exists, ignoring
client asked to cancel request 1304, but no such pending request exists, ignoring
client asked to cancel request 1305, but no such pending request exists, ignoring
client asked to cancel request 1306, but no such pending request exists, ignoring
client asked to cancel request 1307, but no such pending request exists, ignoring
client asked to cancel request 1308, but no such pending request exists, ignoring
client asked to cancel request 1314, but no such pending request exists, ignoring
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
client asked to cancel request 1324, but no such pending request exists, ignoring
successfully cancelled request with ID: 1330
successfully cancelled request with ID: 1333
successfully cancelled request with ID: 1332
client asked to cancel request 1327, but no such pending request exists, ignoring
successfully cancelled request with ID: 1337
successfully cancelled request with ID: 1334
successfully cancelled request with ID: 1338
successfully cancelled request with ID: 1335
successfully cancelled request with ID: 1341
successfully cancelled request with ID: 1340
client asked to cancel request 1325, but no such pending request exists, ignoring
successfully cancelled request with ID: 1339
client asked to cancel request 1326, but no such pending request exists, ignoring
client asked to cancel request 1336, but no such pending request exists, ignoring
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
client asked to cancel request 1329, but no such pending request exists, ignoring
client asked to cancel request 1331, but no such pending request exists, ignoring
successfully cancelled request with ID: 1345
Unable to send result to client.
successfully cancelled request with ID: 1366
successfully cancelled request with ID: 1369
successfully cancelled request with ID: 1367
successfully cancelled request with ID: 1372
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.

cknight avatar Sep 26 '23 22:09 cknight

After removal of WSL I still have an issue! Renaming an 8.2mb file took more than 10 seconds. The IDE was unusable during this time. No crash or OOM was reported, but why would a file rename take such a long time?

On rename attemps the language server asks the embedded ts server to look for imports that it can rename. I guess that's taking a really long time.

Do either of you have any large dependencies that I can try to reproduce this with? I think the large TS module graph that tsc has to work with in a Deno project might be a factor.

The project I'm working in is only about 25 files. total It has a single external dependency in deps.ts -- export { serve } from "https://deno.land/[email protected]/http/server.ts";

Is there a way for me to print the module graph? This happens in all projects great and small where Deno is enabled.

nhrones avatar Sep 26 '23 22:09 nhrones

Why would an LSP, during a file name change need100% CPU and nearly 3Gig of memory?

nhrones avatar Sep 26 '23 22:09 nhrones

Is there a way for me to print the module graph? This happens in all projects great and small where Deno is enabled.

deno info main.ts will print your dependency tree, including sizes, etc.

cknight avatar Sep 26 '23 22:09 cknight

@nayeemrmn PS C:\Users\nhron\dev\DB\NEW\NewDKV> deno info serve.ts local: C:\Users\nhron\dev\DB\NEW\NewDKV\serve.ts type: TypeScript dependencies: 6 unique size: 30.99KB

file:///C:/Users/nhron/dev/DB/NEW/NewDKV/serve.ts (1.11KB) ├─┬ file:///C:/Users/nhron/dev/DB/NEW/NewDKV/deps.ts (71B) │ └─┬ https://deno.land/[email protected]/http/server.ts (22.14KB) │ └── https://deno.land/[email protected]/async/delay.ts (1.71KB) ├── file:///C:/Users/nhron/dev/DB/NEW/NewDKV/constants.ts (2.07KB) ├─┬ file:///C:/Users/nhron/dev/DB/NEW/NewDKV/post.ts (557B) │ └── file:///C:/Users/nhron/dev/DB/NEW/NewDKV/constants.ts * └─┬ file:///C:/Users/nhron/dev/DB/NEW/NewDKV/denoKvRPC.ts (3.35KB) └── file:///C:/Users/nhron/dev/DB/NEW/NewDKV/constants.ts *

nhrones avatar Sep 26 '23 22:09 nhrones

@nayeemrmn I've never used a Deno.json file, so I did deno init in this small project. It produced not only a deno.json file but also a deno.lock file shown below. How did this small project get so many dependencies? Some are extremely old -- [email protected]

{
  "version": "3",
  "remote": {
    "https://deno.land/[email protected]/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
    "https://deno.land/[email protected]/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49",
    "https://deno.land/[email protected]/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3",
    "https://deno.land/[email protected]/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09",
    "https://deno.land/[email protected]/path/_util.ts": "d16be2a16e1204b65f9d0dfc54a9bc472cafe5f4a190b3c8471ec2016ccd1677",
    "https://deno.land/[email protected]/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633",
    "https://deno.land/[email protected]/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee",
    "https://deno.land/[email protected]/path/mod.ts": "56fec03ad0ebd61b6ab39ddb9b0ddb4c4a5c9f2f4f632e09dd37ec9ebfd722ac",
    "https://deno.land/[email protected]/path/posix.ts": "c1f7afe274290ea0b51da07ee205653b2964bd74909a82deb07b69a6cc383aaa",
    "https://deno.land/[email protected]/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9",
    "https://deno.land/[email protected]/path/win32.ts": "bd7549042e37879c68ff2f8576a25950abbfca1d696d41d82c7bca0b7e6f452c",
    "https://deno.land/[email protected]/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee",
    "https://deno.land/[email protected]/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56",
    "https://deno.land/[email protected]/async/debounce.ts": "adab11d04ca38d699444ac8a9d9856b4155e8dda2afd07ce78276c01ea5a4332",
    "https://deno.land/[email protected]/async/delay.ts": "a6142eb44cdd856b645086af2b811b1fcce08ec06bb7d50969e6a872ee9b8659",
    "https://deno.land/[email protected]/collections/_utils.ts": "5114abc026ddef71207a79609b984614e66a63a4bda17d819d56b0e72c51527e",
    "https://deno.land/[email protected]/collections/deep_merge.ts": "9db788ba56cb05b65c77166b789e58e125dff159b7f41bf4d19dc1cba19ecb8b",
    "https://deno.land/[email protected]/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d",
    "https://deno.land/[email protected]/flags/mod.ts": "0948466fc437f017f00c0b972a422b3dc3317a790bcf326429d23182977eaf9f",
    "https://deno.land/[email protected]/fmt/bytes.ts": "f29cf69e0791d375f9f5d94ae1f0641e5a03b975f32ddf86d70f70fdf37e7b6a",
    "https://deno.land/[email protected]/fmt/colors.ts": "87544aa2bc91087bb37f9c077970c85bfb041b48e4c37356129d7b450a415b6f",
    "https://deno.land/[email protected]/http/etag.ts": "807382795850cde5c437c74bcc09392bc0fc56de348fc1271f383f4b28935b9f",
    "https://deno.land/[email protected]/http/file_server.ts": "6f5c4a28c36995f31544abb49b86bee6e7a2d34664cac3936ff08ccad1682d85",
    "https://deno.land/[email protected]/http/http_status.ts": "8a7bcfe3ac025199ad804075385e57f63d055b2aed539d943ccc277616d6f932",
    "https://deno.land/[email protected]/http/server.ts": "1b2403b3c544c0624ad23e8ca4e05877e65380d9e0d75d04957432d65c3d5f41",
    "https://deno.land/[email protected]/http/util.ts": "4cf044067febaa26d0830e356b0f3a5f76d701a60d7ff7a516fad7b192f4c3a7",
    "https://deno.land/[email protected]/media_types/_db.ts": "7606d83e31f23ce1a7968cbaee852810c2cf477903a095696cdc62eaab7ce570",
    "https://deno.land/[email protected]/media_types/_util.ts": "0879b04cc810ff18d3dcd97d361e03c9dfb29f67d7fc4a9c6c9d387282ef5fe8",
    "https://deno.land/[email protected]/media_types/content_type.ts": "ad98a5aa2d95f5965b2796072284258710a25e520952376ed432b0937ce743bc",
    "https://deno.land/[email protected]/media_types/format_media_type.ts": "f5e1073c05526a6f5a516ac5c5587a1abd043bf1039c71cde1166aa4328c8baf",
    "https://deno.land/[email protected]/media_types/get_charset.ts": "18b88274796fda5d353806bf409eb1d2ddb3f004eb4bd311662c4cdd8ac173db",
    "https://deno.land/[email protected]/media_types/parse_media_type.ts": "31ccf2388ffab31b49500bb89fa0f5de189c8897e2ee6c9954f207637d488211",
    "https://deno.land/[email protected]/media_types/type_by_extension.ts": "daa801eb0f11cdf199445d0f1b656cf116d47dcf9e5b85cc1e6b4469f5ee0432",
    "https://deno.land/[email protected]/media_types/vendor/mime-db.v1.52.0.ts": "6925bbcae81ca37241e3f55908d0505724358cda3384eaea707773b2c7e99586",
    "https://deno.land/[email protected]/path/_basename.ts": "057d420c9049821f983f784fd87fa73ac471901fb628920b67972b0f44319343",
    "https://deno.land/[email protected]/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0",
    "https://deno.land/[email protected]/path/_dirname.ts": "355e297236b2218600aee7a5301b937204c62e12da9db4b0b044993d9e658395",
    "https://deno.land/[email protected]/path/_extname.ts": "eaaa5aae1acf1f03254d681bd6a8ce42a9cb5b7ff2213a9d4740e8ab31283664",
    "https://deno.land/[email protected]/path/_format.ts": "4a99270d6810f082e614309164fad75d6f1a483b68eed97c830a506cc589f8b4",
    "https://deno.land/[email protected]/path/_from_file_url.ts": "6eadfae2e6f63ad9ee46b26db4a1b16583055c0392acedfb50ed2fc694b6f581",
    "https://deno.land/[email protected]/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b",
    "https://deno.land/[email protected]/path/_is_absolute.ts": "05dac10b5e93c63198b92e3687baa2be178df5321c527dc555266c0f4f51558c",
    "https://deno.land/[email protected]/path/_join.ts": "815f5e85b042285175b1492dd5781240ce126c23bd97bad6b8211fe7129c538e",
    "https://deno.land/[email protected]/path/_normalize.ts": "a19ec8706b2707f9dd974662a5cd89fad438e62ab1857e08b314a8eb49a34d81",
    "https://deno.land/[email protected]/path/_os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3",
    "https://deno.land/[email protected]/path/_parse.ts": "0f9b0ff43682dd9964eb1c4398610c4e165d8db9d3ac9d594220217adf480cfa",
    "https://deno.land/[email protected]/path/_relative.ts": "27bdeffb5311a47d85be26d37ad1969979359f7636c5cd9fcf05dcd0d5099dc5",
    "https://deno.land/[email protected]/path/_resolve.ts": "7a3616f1093735ed327e758313b79c3c04ea921808ca5f19ddf240cb68d0adf6",
    "https://deno.land/[email protected]/path/_to_file_url.ts": "a141e4a525303e1a3a0c0571fd024552b5f3553a2af7d75d1ff3a503dcbb66d8",
    "https://deno.land/[email protected]/path/_to_namespaced_path.ts": "0d5f4caa2ed98ef7a8786286df6af804b50e38859ae897b5b5b4c8c5930a75c8",
    "https://deno.land/[email protected]/path/_util.ts": "4e191b1bac6b3bf0c31aab42e5ca2e01a86ab5a0d2e08b75acf8585047a86221",
    "https://deno.land/[email protected]/path/basename.ts": "bdfa5a624c6a45564dc6758ef2077f2822978a6dbe77b0a3514f7d1f81362930",
    "https://deno.land/[email protected]/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000",
    "https://deno.land/[email protected]/path/dirname.ts": "b6533f4ee4174a526dec50c279534df5345836dfdc15318400b08c62a62a39dd",
    "https://deno.land/[email protected]/path/extname.ts": "62c4b376300795342fe1e4746c0de518b4dc9c4b0b4617bfee62a2973a9555cf",
    "https://deno.land/[email protected]/path/format.ts": "110270b238514dd68455a4c54956215a1aff7e37e22e4427b7771cefe1920aa5",
    "https://deno.land/[email protected]/path/from_file_url.ts": "9f5cb58d58be14c775ec2e57fc70029ac8b17ed3bd7fe93e475b07280adde0ac",
    "https://deno.land/[email protected]/path/glob.ts": "593e2c3573883225c25c5a21aaa8e9382a696b8e175ea20a3b6a1471ad17aaed",
    "https://deno.land/[email protected]/path/is_absolute.ts": "0b92eb35a0a8780e9f16f16bb23655b67dace6a8e0d92d42039e518ee38103c1",
    "https://deno.land/[email protected]/path/join.ts": "31c5419f23d91655b08ec7aec403f4e4cd1a63d39e28f6e42642ea207c2734f8",
    "https://deno.land/[email protected]/path/mod.ts": "6e1efb0b13121463aedb53ea51dabf5639a3172ab58c89900bbb72b486872532",
    "https://deno.land/[email protected]/path/normalize.ts": "6ea523e0040979dd7ae2f1be5bf2083941881a252554c0f32566a18b03021955",
    "https://deno.land/[email protected]/path/parse.ts": "be8de342bb9e1924d78dc4d93c45215c152db7bf738ec32475560424b119b394",
    "https://deno.land/[email protected]/path/posix.ts": "0a1c1952d132323a88736d03e92bd236f3ed5f9f079e5823fae07c8d978ee61b",
    "https://deno.land/[email protected]/path/relative.ts": "8bedac226afd360afc45d451a6c29fabceaf32978526bcb38e0c852661f66c61",
    "https://deno.land/[email protected]/path/resolve.ts": "133161e4949fc97f9ca67988d51376b0f5eef8968a6372325ab84d39d30b80dc",
    "https://deno.land/[email protected]/path/separator.ts": "40a3e9a4ad10bef23bc2cd6c610291b6c502a06237c2c4cd034a15ca78dedc1f",
    "https://deno.land/[email protected]/path/to_file_url.ts": "00e6322373dd51ad109956b775e4e72e5f9fa68ce2c6b04e4af2a6eed3825d31",
    "https://deno.land/[email protected]/path/to_namespaced_path.ts": "1b1db3055c343ab389901adfbda34e82b7386bcd1c744d54f9c1496ee0fd0c3d",
    "https://deno.land/[email protected]/path/win32.ts": "8b3f80ef7a462511d5e8020ff490edcaa0a0d118f1b1e9da50e2916bdd73f9dd",
    "https://deno.land/[email protected]/streams/byte_slice_stream.ts": "c46d7c74836fc8c1a9acd9fe211cbe1bbaaee1b36087c834fb03af4991135c3a",
    "https://deno.land/[email protected]/version.ts": "93ab592680d0d50d5269536653f52e2a446d85497e4d71a38e65de533093c040",
    "https://deno.land/x/[email protected]/mod.ts": "f5628e44b80b3d80ed525afa2ba0f12408e3849db817d47a883b801f9ce69dd6",
    "https://deno.land/x/[email protected]/pkg/denoflate.js": "b9f9ad9457d3f12f28b1fb35c555f57443427f74decb403113d67364e4f2caf4",
    "https://deno.land/x/[email protected]/pkg/denoflate_bg.wasm.js": "d581956245407a2115a3d7e8d85a9641c032940a8e810acbd59ca86afd34d44d",
    "https://deno.land/x/[email protected]/mod.js": "4f4e61964a551d9c0baf5bb19e973cf631cf8c66ddaf01e70070f8a100fc938c",
    "https://deno.land/x/[email protected]/deps.ts": "fe86f62cb954edc2580868cdc3292d4446f22cd2c4eedbf8ee26513fdf74e343",
    "https://deno.land/x/[email protected]/mod.ts": "5d8a429b26c70f9fd522a8629e751f3bdf63680da473e537bc420d552ee3bf0b",
    "https://deno.land/x/[email protected]/src/deno.ts": "0e83ccabbe2b004389288e38df2031b79eb347df2d139fce9394d8e88a11f259",
    "https://deno.land/x/[email protected]/src/native_loader.ts": "343854a566cf510cf25144f7c09fc0c1097780a31830305142a075d12bb697ba",
    "https://deno.land/x/[email protected]/src/portable_loader.ts": "35b6c526eed8c2c781a3256b23c30aa7cce69c0ef1d583c15528663287ba18a3",
    "https://deno.land/x/[email protected]/src/shared.ts": "b64749cd8c0f6252a11498bd8758ef1220003e46b2c9b68e16da63fd7e92b13a",
    "https://deno.land/x/[email protected]/_util.ts": "ada9a9618b537e6c0316c048a898352396c882b9f2de38aba18fd3f2950ede89",
    "https://deno.land/x/[email protected]/mod.ts": "ae3d1cd7eabd18c01a4960d57db471126b020f23b37ef14e1359bbb949227ade",
    "https://raw.githubusercontent.com/nhrones/Browser/master/browser.ts": "4c1cb8fb1feab5d33bf9af72a8c1ecae43abfef0f22bf95c503bd402f5277c1a"
  }
}

I guess I really don't understand Deno.
Also, why would the LSP crawl all of this for a simple file name change?

This project has a /src/ folder that has ts files that get bundled to a /dist/ folder. I use my own dev server for this. Is this all included in the file name change?
The dev-server and it's dependencies are never referenced in this project, yet some of its dependencies are in this deno.lock?

nhrones avatar Sep 27 '23 00:09 nhrones

For the record I don't think that's so many it would cause the problems mentioned in this issue -- I wouldn't put too much stock in my theory above.

How did this small project get so many dependencies? Some are extremely old -- [email protected]

The old std version is used by esbuild_deno_loader 0.6.0.

nayeemrmn avatar Sep 27 '23 00:09 nayeemrmn

After removal of WSL I still have an issue! Renaming an 8.2mb file took more than 10 seconds. The IDE was unusable during this time. No crash or OOM was reported, but why would a file rename take such a long time?

@nhrones I missed the 8.2mb part -- that's a really large file! For example our 00_typescript.js bundle is 8.1mb and is 174,000 LOC. I observed this behaviour on the regular node TS extension as well. So your case is behaving as expected.

I know it's unintuitive that the renamed file has to be scanned but I guess tsc needs to analyse the project holistically.

nayeemrmn avatar Sep 27 '23 01:09 nayeemrmn

@nayeemrmn That's a json file with 100k user objects. The problem is, if I rename mod.ts with only several lines of code, it acts the same?

And now I can no longer enable deno in that project.

All values below are from TaskManager

When vsc opens this project with Deno disabled:
Visual Studio Code   		401 MB
After a file name change   	425 MB

When vsc opens this project with Deno enabled:
  Visual Studio Code 		2,220 MB
    Deno:A secure runtime  	1,759 MB

During a file name change   	
  Visual Studio Code 		4,427 MB
    Deno:A secure runtime  	2,899 MB

This high memory use stays this way for several minutes
never drops below
  Visual Studio Code 		3,370 MB
    Deno:A secure runtime  	2,213 MB
Screenshot 2023-09-26 221158

nhrones avatar Sep 27 '23 02:09 nhrones

I've restarted my computer, and still can't get Deno enabled in this project? Any suggestions?

nhrones avatar Sep 27 '23 02:09 nhrones

Okay @nhrones seems it alleviates the issue if you add the following to your VSCode settings:

{
  "deno.enable": true,
  "deno.disablePaths": ["<your_big_file_goes_here>.json"],
}

nayeemrmn avatar Sep 27 '23 02:09 nayeemrmn

@nayeemrmn Yes! Thank you so much! Does this need to be an array of filePaths, or can I disable one or more folders?

"deno.disablePaths": ["./dist/"],

nhrones avatar Sep 27 '23 02:09 nhrones

Does this need to be an array of filePaths, or can I disable one or more folders?

"deno.disablePaths": ["./dist/"],

You can, disabling dist folder is an exemplary use case!

nayeemrmn avatar Sep 27 '23 02:09 nayeemrmn

I can confirm this has solved my issues of moving and renaming files with deno enabled! Much thanks again. I was about to give up on Deno, but you've created a fan.

Seems that the excess memory being consumed was related to the large json data files. In the future I'll create a data folder, and disablePath to it.

I've also disabled ./.vscode/ and a ./docs/ folder. This reduced memory consumption even more.

Again, Thanks for all your hard work.

nhrones avatar Sep 27 '23 03:09 nhrones

This is still happening for me on Deno 1.37.1, however the output is somewhat different:

1.37.1 hang output

Starting Deno language server...
  version: 1.37.1 (release, x86_64-unknown-linux-gnu)
  executable: /home/chris/.deno/bin/deno
Connected to "Visual Studio Code" 1.82.2
  Auto-resolved configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Setting import map defined in configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
  Resolved import map: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Enabling import suggestions for: https://deno.land
Download https://deno.land/.well-known/deno-import-intellisense.json
Starting Deno language server...
  version: 1.37.1 (release, x86_64-unknown-linux-gnu)
  executable: /home/chris/.deno/bin/deno
Connected to "Visual Studio Code" 1.82.2
  Auto-resolved configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Setting import map defined in configuration file: "file:///home/chris/dev/deno/kv-explorer/deno.json"
  Resolved import map: "file:///home/chris/dev/deno/kv-explorer/deno.json"
Enabling import suggestions for: https://deno.land
Server ready.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.
Unable to send result to client.

I'm not sure how true this holds as I've not had extensive time for development in the last day or so, but the LSP hangs primarily occurs in my types.ts file. The hang can sometimes be triggered by simply opening this file. The only major difference in this file compared to others in the project is that it has 13 exports?

cknight avatar Sep 27 '23 21:09 cknight

Have you tried nayeemrmns fix above?

{
  "deno.enable": true,
  "deno.disablePaths": ["<your_file_goes_here>"],
}

nhrones avatar Sep 27 '23 23:09 nhrones

I’m experiencing the same issues in a Deno project based on Slack’s starter template. There are no big files to ignore. I have to restart the language server pretty much every ~5 changes I make to a file.

eelco avatar Oct 05 '23 13:10 eelco