microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.49k stars 28.65k forks source link

RAM Usage spike when waking system while running GHCi in Integrated Terminal #41016

Closed shingtaklam1324 closed 6 years ago

shingtaklam1324 commented 6 years ago
Extension Author (truncated) Version
language-x86-64-assembly 13x 2.2.11
compulim-vscode-closetag Com 1.1.0
dart-code Dan 2.6.2
vscode-markdownlint Dav 0.12.0
vsc-material-theme Equ 1.2.0
gc-excelviewer Gra 2.0.16
beautify Hoo 1.1.1
Ionide-fsharp Ion 3.15.7
latex-workshop Jam 3.11.0
vscode-github Kni 0.25.0
material-icon-theme PKi 3.2.0
html-snippets abu 0.2.1
yaml ada 0.0.9
vscode-hie-server ala 0.0.6
better-toml bun 0.3.1
path-intellisense chr 1.4.2
jshint dba 0.10.15
githistory don 0.2.3
jupyter don 1.1.4
vscode-html-css ecm 0.1.8
crystal-lang fau 0.3.9
auto-rename-tag for 0.0.15
code-runner for 0.8.7
reasonml fre 1.0.17
vscode-ghc-mod hoo 1.2.0
language-julia jul 0.9.1
language-haskell jus 2.4.0
vscode-regexp-preivew le0 0.0.3
vscode-sciter lon 0.0.2
Go luk 0.6.70
vscode-elixir mjm 1.1.0
python ms- 0.9.1
cpptools ms- 0.14.5
csharp ms- 1.13.1
live-server-preview neg 0.0.4
vscode-code-outline pat 0.0.12
Ruby reb 0.15.0
LiveServer rit 3.0.2
vscode-icons rob 7.19.0
rust rus 0.3.2
elm sbr 0.15.1
preview-vscode sea 1.4.2
code-spell-checker str 1.6.2
vscode-lldb vad 0.7.3
vscode-arduino vsc 0.2.10
debug web 0.21.2
better-align wwm 1.1.6
erlang-otp yuc 0.2.4
markdown-pdf yza 0.1.7

(10 theme extensions excluded)


Steps to Reproduce:

  1. Before sleeping - RAM Usage is ~ 500M
  2. stack ghci
  3. Sleep Computer
  4. Reopen Computer
  5. RAM Usage now ~ 2G

Reproduces without extensions: Yes

shingtaklam1324 commented 6 years ago

This is not (as far as I can tell) not a ghci bug as this does not occur when running the exact same commands with the system built in Terminal and VSCode open on the side, but does seem to be a Haskell specific bug on VSCode as irb (Ruby), python3 (Python) and iex (Elixir) all behave properly.

Tyriar commented 6 years ago

What is stack/ghci and how do you set them up?

shingtaklam1324 commented 6 years ago

@tyriar Stack is the tool for managing Haskell projects and tooling, and is downloaded here. It is roughly like Cargo for Rust.

Tyriar commented 6 years ago

I can't reproduce:

Open code and a terminal

❯ code --status
...
CPU %   Mem MB  Process
    1       67  code main
    0        8     zygote
    2      166       window (Release Notes: 1.19.1 - vscode-snap - Visual Studio Code)
    0       16         terminal
    0        4           /bin/bash
   10      304         watcherService
    0       47         extensionHost
    0       39       shared-process
    0       55       window (undefined)

Open ghci

❯ code --status
...
CPU %   Mem MB  Process
    1       75  code main
    0        8     zygote
    2      178       window (Release Notes: 1.19.1 - vscode-snap - Visual Studio Code)
    0       20         terminal
    0        4           /bin/bash
    5       63             stack ghci
    3      111               /home/parallels/.stack/programs/x86_64-linux/ghc-8.2.2/lib/ghc-8.2.2/bin/ghc -B/home/parallels/.stack/programs/x86_64-linux/ghc-8.2.2/lib/ghc-8.2.2 --interactive -odir=/home/parallels/.stack/global-project/.stack-work/odir -hidir=/home/parallels/.stack/global-project/.stack-work/odir -ghci-script=/tmp/ghci9055/ghci-script
    9      304         watcherService
    0       47         extensionHost
    0       39       shared-process
    0       55       window (undefined)

Suspend and wake up

❯ code --status
...
CPU %   Mem MB  Process
    1       75  code main
    0        8     zygote
    2      178       window (Release Notes: 1.19.1 - vscode-snap - Visual Studio Code)
    0       20         terminal
    0        4           /bin/bash
    1       63             stack ghci
    1      118               /home/parallels/.stack/programs/x86_64-linux/ghc-8.2.2/lib/ghc-8.2.2/bin/ghc -B/home/parallels/.stack/programs/x86_64-linux/ghc-8.2.2/lib/ghc-8.2.2 --interactive -odir=/home/parallels/.stack/global-project/.stack-work/odir -hidir=/home/parallels/.stack/global-project/.stack-work/odir -ghci-script=/tmp/ghci9055/ghci-script
    8      304         watcherService
    0       47         extensionHost
    0       39       shared-process
    0       55       window (undefined)
Tyriar commented 6 years ago

Also we can only really do something about it if the process causing the memory usage is at the level of "terminal" or above. If you could try repro using these steps code --status that would be good.

shingtaklam1324 commented 6 years ago

I've done some more bug testing and seems like a combination of software running on my computer. It doesn't seem to be a bug with VS Code now that I have tested it on other Linux distros, but rather the way Elementary OS handles sleeping compared to the other distros. Thanks a lot anyways.

Tyriar commented 6 years ago

Weird, let me know if you find out more