dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.26k stars 1.58k forks source link

VS Code: Analysis server terminates with "Out of memory" #48224

Open andim27 opened 2 years ago

andim27 commented 2 years ago

VS Code ver 1.63 Flutter (Channel stable, 2.8.1, on Linux Mint 20.3 5.4.0-96-generic, locale en_US.UTF-8) flutter doctor - all is ok vs_code_no_error vs_code_refactoring_error

bwilkerson commented 2 years ago

@DanTup

DanTup commented 2 years ago

@andim27 in one of your screenshots the items is there, and in the other it's not. What did you do differently between the screenshots?

It looks like perhaps the extension has not been activated for the second screenshot. Do you see any errors listed if you click Help -> Toggle Developer Tools in VS Code, then click on the Console tab at the top?

andim27 commented 2 years ago

This has been happening quite often lately when building large projects.

DanTup commented 2 years ago

This has been happening quite often lately when building large projects.

Do you mean compiling Flutter applications? For any specific target platform? (Linux desktop, or Android?)

Do you recall seeing any popup notifications about the analysis server restarting when this happens? The things that are missing are all from the language server, suggesting the language server has either not initialised, or has terminated (which results in being unregistered). The presence of the Flutter UI guides suggests the extension has activated though.

Next time you see it, could you check for error notifications in the bottom right corner (they may collapse into the bell icon), and the developer tools console mentioned above, to see if there are any error messages that might help us understand/reproduce the issue? Thanks!

andim27 commented 2 years ago

yes, sometimes the PopUp Window from analysis server appears but restarting it doesn't helps/Platform: Linux building for Android

DanTup commented 2 years ago

@andim27 do you know exactly what the popup says? Can you give a screenshot next time it occurs? Could you also check the console in the VS Code developer tools mentioned above to see if there is a more detailed error there when this happens? Thanks!

andim27 commented 2 years ago

{"method":"$/progress","params":{"token":"ANALYZING","value":{"kind":"end"}},"jsonrpc":"2.0"} [12:47:57 PM] [Analyzer] [Info] <== Content-Length: 220 Content-Type: application/vscode-jsonrpc; charset=utf-8 [12:48:12 PM] [Analyzer] [Error] ../../runtime/vm/zone.cc: 94: error: Out of memory. version=2.15.1 (stable) (Tue Dec 14 13:32:21 2021 +0100) on "linux_x64" pid=8191, thread=12640, isolate_group=(nil)((nil)), isolate=(nil)((nil)) isolate_instructions=0, vm_instructions=559bdc0c5600 [12:48:12 PM] [Analyzer] [Error] ../../runtime/vm/zone.cc: 94: error: Out of memory. Aborting re-entrant request for stack trace. [12:48:40 PM] [Analyzer] [Error] Aborted (core dumped) [12:48:40 PM] [Analyzer] [Info] Spawning.../bin/cache/dart-sdk/bin/dart with args ["language-server","--client-id=VS-Code","--client-version=3.32.0"] [12:48:40 PM] [Analyzer] [Info] PID: 12894 [12:48:41 PM] [Analyzer] [Info] ==> Content-Length: 4917

Memory on computer is enough

DanTup commented 2 years ago

@andim27 could you post the full output of running code --status when you have the project open that's causing this (ideally after you've been coding for some time, so if it's memory usage is growing that may be clear from the stats)? Thanks!

DanTup commented 2 years ago

@andim27 do you still see this problem? Are you able to post the full output from running code --status while the project is open?

andim27 commented 2 years ago

Now - not but in any cases dart-tooling, refactoring in the right click menu is needed to be more flexible.It's very slowly and lives its own life(((

DanTup commented 2 years ago

@andim27 do you mean the crash is gone and the refactors are visible, but they take a long time to execute?

If so, does this happen always, or is it intermittent?

andim27 commented 2 years ago

this cases appears on large projects

DanTup commented 2 years ago

@andim27 Are you able to post the full output from running code --status while the project is open?