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

Potential memory leak #50280

Closed
shawmanz32na opened this issue May 22, 2018 · 30 comments
Closed

Potential memory leak #50280

shawmanz32na opened this issue May 22, 2018 · 30 comments
Assignees
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster

Comments

@shawmanz32na
Copy link

Issue Type: Bug

I have noticed extremely high memory usage on my machine for the last few days (at least), but couldn't pinpoint the problem from my Windows task manager. Today, I started troubleshooting by closing open applications, one at a time, to see what helped. It just so happened that the first application I closed was VS Code. Suddenly, 8GB of RAM became available. Here's a screenshot:
image

I can't give you too many more details, except that I often leave VS Code open when I go home from work, and it seems as though the longer it's open, the worse it performs.

To reproduce, launch VS Code, then go have coffee, have lunch, attend and afternoon meeting, go home, come back, do it all again, go home, come back, and look at VS Code's memory usage.

VS Code version: Code 1.23.1 (d0182c3, 2018-05-10T17:11:17.614Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz (8 x 2395)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: unavailable_software
webgl: enabled
webgl2: enabled
Memory (System) 15.88GB (6.15GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
vscode-eslint dba 1.4.10
mssql ms- 1.3.1
PowerShell ms- 1.7.0
vscode-docker Pet 0.0.27
java red 0.25.0
vscode-java-debug vsc 0.9.0
vscode-java-pack vsc 0.3.0
vscode-java-test vsc 0.6.1
vscode-maven vsc 0.8.0
@tommai78101
Copy link

tommai78101 commented May 22, 2018

I'm guessing my issue is related to what you're observing?

#50279

I just reported that issue a few minutes before you. Yeah, it seems there are some performance degradation happening on Visual Studio Code. I have the same habit of yours where I leave VS Code running for long hours.

@weinand weinand added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label May 22, 2018
@rebornix
Copy link
Member

Could you please run Open Process Explorer from Command Palette and share with us what process is consuming that much memory?

@rebornix rebornix added the info-needed Issue requires more information from poster label May 22, 2018
@shawmanz32na
Copy link
Author

@rebornix As I found VS Code to be the memory hog only by closing it, I don't have the process information from before it was closed. Having been open for a few hours this morning, the processes have the following details:
image

I'll leave VS Code open for the remainder of the day and into tomorrow, and will report again then.

@rebornix
Copy link
Member

@shadowfacts thanks! If it only happens when you close the window, you can run code --status from command line when the window is closed but the instance is eating the memory. It can give the information we need.

@chungweileong94
Copy link

This happening to me these days as well, even the entire OS is freeze. I also tried disable all the extensions, it always suing around 1GB out of the 8GB RAM, which is even worst if I having multiple browser tabs open mostly for web development,

@shawmanz32na
Copy link
Author

Sure enough, my computer was all frozen up again this morning. With my VS Code instances open for the last couple of days, here's the VS Code process explorer, and here's my Windows process explorer.
image
As you can see, the maths don't work out, as Windows reports a usage of ~4GB, even when totalling up every row in the list. VS Code, also, doesn't seem to see any notable memory usage. However, again, closing VS Code (and nothing else), results in a memory usage of ~8GB.
image
This means that whatever process is leaking memory, it seems to be doing so w/o VS Code's nor Windows' knowledge.

@tommai78101
Copy link

Did you have a CPU profile? @shawmanz32na

I was told that CPU profile dump is more important for tracking down the slowdowns.

@shawmanz32na
Copy link
Author

Per @tommai78101 's comment, I'm happy to create a CPU profile, although I have no idea what actions would be appropriate to perform while profiling. My concern is that something is eating memory, and if I know what that thing was so that I could profile it, we wouldn't need to profile it, right? I can take a profile of something mundane, like editing a markdown document, if someone thinks that the profile might magically reveal whatever is gobbling memory.

I'll await for further instruction before creating a CPU profile dump.

@tommai78101
Copy link

tommai78101 commented May 25, 2018

@shawmanz32na See middle post with CPU Profiler GIF at #50279 .

#50279 (comment)

And try to help out by completing the specified ACTIONs. I'm doing mine.

@shawmanz32na
Copy link
Author

@rebornix This issue is still marked as needs more info, but I'm confused as to what info you want more of. Do you have the information you need? If not, can you provide instructions for me to get that info?

@tommai78101
Copy link

tommai78101 commented May 29, 2018

EDIT: Just saw you tag someone else. Whoops!

I'm guessing you need to do:

  • A full CPU Profile that is recording the slowdowns you're experiencing when using VS Code normally, and attach the file as a ZIP file here. It's best to wait until slowdowns are occurring, then start the CPU profiling, before you attach that profile here.

  • An extension profile that is also recording the latency that is calling on VS Code's native APIs, doing the following steps:

  1. F1 > Developer: Show running extensions
  2. Mouse over top right corner
  3. Hit white circle
  4. See red circle (it's recording)
  5. Reproduce slowdowns
  6. Cancel recording (clicking on red circle)
  7. Save profile (next to the white/red circle, click the floppy disk icons)
  8. Attach saved profile text file here.

@OneOfAFewCoders
Copy link

I've been having similar issues and I think it may be tied to a garbage collection system or open files/handles not being closed/released. I recently upgraded my system from 12 GB to 24 GB of memory and I still frequently end up with ~90% memory usage. Everything excluding VS Code uses ~2 GB(before and after the upgrade) and VS Code uses the remaining 10-20 GB of memory even with no tabs open in VS Code. Getting up to 10-20 GB memory usage usually requires the intellisense databases in the AppData/Roaming/Code/User/workspaceStorage folder to load by briefly opening a file associated with each project in the workspace. Closing the VS Code window or loading a different workspace in the window doing most of the intellisense work will free up ~20GB of memory. The intellisense DBs for each project in my workspace use about 16 GB(See Image Below) on disk when uncompressed. They all share similar includes and there's 24 different DBs at ~740MB each currently. Closing every tab doesn't seem to close down any of the CPP extensions loaded by Code. Waiting until all the significant CPU and HD activity has finished has no noticeable impact on memory usage either. I was able to free up most of that memory by opening a different workspace in the open Code windows that were doing the intellisense work but I'm unfamiliar with what is being unloaded and reloaded by Code when that occurs.

vs code memory usage
vs code harddrive usage

@rebornix
Copy link
Member

rebornix commented Jun 1, 2018

@OneOfAFewCoders to your specific issue, it looks like a CPP extension issue, I ran into high CPU/memory with CPP extension sometimes, I'll suggest filing issue against https://github.com/Microsoft/vscode-cpptools first for this one.

@rebornix
Copy link
Member

rebornix commented Jun 1, 2018

@shawmanz32na don't worry too much about the needs more info tag, it simply means we are in the progress of hunting down the root cause and we need helps from you ;) Questions I have right now with the problem you just ran into

  • Do you have any workspace open before the os froze? If any, what kind of project it's about? I have a feeling it's Java related.
  • If you run vscode with extensions disabled, can you still reproduce this issue?
  • If disabling all extensions is too much, I'll suggest disabling Java extension first.

I'm not an expert with how Windows calculate the memory, @joaomoreno can I have your help on this?

@joaomoreno
Copy link
Member

@bpasero Has a good step list for this, I believe.

@bpasero
Copy link
Member

bpasero commented Jun 4, 2018

Here is a checklist to find out more about the freeze/slow/crash

  • it reproduces with extensions disabled (code --disable-extensions from the command line - NOT the integrated terminal of Code)
    • if it does not reproduce with extensions disabled, you can stop testing and report this!
  • it was not happening in the previous stable release
  • it reproduces in insiders builds (get it from here)
  • there is no suspicious output when running from the command line (code --verbose)
  • there is no suspicious output in the window itself (Help | Toggle Developer Tools | Console)
  • it reproduces on Windows, Linux and Mac
  • it reproduces after deleting <appdata>/User/keybindings.json and <appdata>/User/settings.json (backup first! see below for paths)
  • it reproduces when opening empty (code -n from the command line)
  • it reproduces opening any folder
  • it reproduces opening any file
  • it reproduces when only having a single window open
  • it reproduces by just using Code without external tools running on the same folder
  • it reproduces from a workspace that is not under Git version control
  • it reproduces independently if a file is opened or not after startup
  • it reproduces when running with GPU disabled (code --disable-gpu)
  • it reproduces when being offline
  • it reproduces when disabling the file watching (set files.watcherExclude to "**/**": true)
  • it reproduces after uninstalling and reinstalling
  • it reproduces after deleting the application data directory (backup first! see below for paths)
  • I have not played around with permissions or ran Code as administrator
  • I am seeing a single CPU process spin high (please share the full command line arguments)
  • I am seeing Code consuming lots of memory in a short time

Application Data Directory for VS Code:

  • Windows: C:\Users\<user>\AppData\Roaming\Code
  • Mac: /Users/<user>/Library/Application Support/Code
  • Linux: /home/<user>/.config/Code

Application Data Directory for VS Code Insiders:

  • Windows: C:\Users\<user>\AppData\Roaming\Code - Insiders
  • Mac: /Users/<user>/Library/Application Support/Code - Insiders
  • Linux: /home/<user>/.config/Code - Insiders

@ghost
Copy link

ghost commented Jun 8, 2018

I'm now also running into a serious freeze/memory leak after the 1.24.0 release. I've now run into this at least three times today. This reproduces when building the solution of my C++ project (can be found here, should be relatively straightforward to build). It doesn't seem to always happen, but every time it has happened was while running a build task.

image

I'll try to provide more information as I am able, but here's what I have so far:

  • it reproduces with extensions disabled (code --disable-extensions from the command line - NOT the integrated terminal of Code)
    • if it does not reproduce with extensions disabled, you can stop testing and report this!
  • it was not happening in the previous stable release
  • it reproduces in insiders builds
  • there is no suspicious output when running from the command line (code --verbose)
  • there is no suspicious output in the window itself (Help | Toggle Developer Tools | Console)
  • it reproduces on Windows, Linux and Mac
  • it reproduces after deleting <appdata>/User/keybindings.json and <appdata>/User/settings.json (backup first! see below for paths)
  • it reproduces when opening empty (code -n from the command line)
  • it reproduces opening any folder
  • it reproduces opening any file
  • it reproduces when only having a single window open
  • it reproduces by just using Code without external tools running on the same folder
  • it reproduces from a workspace that is not under Git version control
  • it reproduces independently if a file is opened or not after startup
  • it reproduces when running with GPU disabled (code --disable-gpu)
  • it reproduces when being offline
  • it reproduces when disabling the file watching (set files.watcherExclude to "**/**": true)
  • it reproduces after uninstalling and reinstalling
  • it reproduces after deleting the application data directory (backup first! see below for paths)
  • I have not played around with permissions or ran Code as administrator
  • I am seeing a single CPU process spin high (please share the full command line arguments)
  • I am seeing Code consuming lots of memory in a short time

I'm not using any command-line arguments when launching code.

@joaomoreno joaomoreno removed their assignment Jun 11, 2018
@ghost
Copy link

ghost commented Jun 13, 2018

I ran with code --disable-gpu --verbose for a couple of days and couldn't reproduce this. I removed the --disable-gpu flag yesterday and this started happening again.

VS Code locked up while building the project, but it seemed to resolve on its own after the build completed.

Unfortunately I didn't manage to get data from during the event because of the lock-up, but here's code --status from shortly after it resolved, which shows unusually (?) large memory usage for gpu-process. I ran the command again afterwards and it seems to have returned back to using around 200 MB or so.

Version:          Code 1.24.0 (6a6e02cef0f2122ee1469765b704faf5d0e0d859, 2018-06-06T17:35:40.560Z)
OS Version:       Windows_NT x64 10.0.17134
CPUs:             Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 x 4000)
Memory (System):  31.95GB (15.58GB free)
VM:               0%
Screen Reader:    no
Process Argv:     C:\Program Files\Microsoft VS Code\Code.exe --verbose
GPU Status:       2d_canvas:                    enabled
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                disabled_software
                  video_decode:                 enabled
                  video_encode:                 enabled
                  vpx_decode:                   enabled
                  webgl:                        enabled
                  webgl2:                       enabled
CPU %   Mem MB     PID  Process
    2       96   41196  code main
    0     1677    5040     shared-process
    9      394   32564     window (window.hpp - polygonist - Visual Studio Code)
    0       28   25828       searchService
    1       70   41140       extensionHost
    0      133   56644         c:\Users\***\.vscode\extensions\ms-vscode.cpptools-0.17.4\bin\Microsoft.VSCode.CPP.Extension.exe
    0      273   13468           c:\Users\***\.vscode\extensions\ms-vscode.cpptools-0.17.4/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 56644 22
    0      328   26796           c:\Users\***\.vscode\extensions\ms-vscode.cpptools-0.17.4/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 56644 19
    0      280   30396           c:\Users\***\.vscode\extensions\ms-vscode.cpptools-0.17.4/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 56644 20
    0      275   37920           c:\Users\***\.vscode\extensions\ms-vscode.cpptools-0.17.4/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 56644 21
    0      272   42848           c:\Users\***\.vscode\extensions\ms-vscode.cpptools-0.17.4/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 56644 23
    0        1   58176           console-window-host (Windows internal process)
    0        8   49120       watcherService
    0        1   45928         console-window-host (Windows internal process)
    0        1   56688       electron-crash-reporter
    6     1694   47932     gpu-process
    0       29   56004     shared-process

Workspace Stats:
|  Window (window.hpp - polygonist - Visual Studio Code)
|    Folder (polygonist): 3276 files
|      File types: tlog(429) obj(407) html(382) png(316) hpp(265) jpg(240)
|                  cpp(218) inl(134) xml(102) pdb(89)
|      Conf files: cmake(2) sln(1) launch.json(1) tasks.json(1)
|                  settings.json(1)
Unable to parse C:\Users\***\Development\polygonist\.vscode\launch.json

I've attached the log from running code --verbose, but I can't see anything unusual in the file. The timestamp of the lock-up can be found by grepping for "detected unresponsive".

vscode-lockup.log

@PatriceVignola
Copy link

PatriceVignola commented Jun 18, 2018

@aleksijuvani I was also running vscode without my GPU for the past month, but it was disabled from the Bios instead of the flag. I never had memory problems even though I basically never close vscode. But yesterday, I enabled the GPU and I had to reboot my frozen computer 3 times since then, which is why I stumbled upon this issue. It really seems to be related to the GPU.

As a sidenote, I initially thought it was related to the "save" function since all 3 crashes happened right when I was saving my work, but it's probably a coincidence since I save very often anyways.

@pievalentin
Copy link

Yep me too on my two 8GB Fedora machine when opening two vscode instance i now often hit swap and come to a full OS freeze. Dunno how to investigate further though but would be glad to help.

@tommai78101
Copy link

tommai78101 commented Jul 19, 2018

@focom Just go ahead and complete the checklist provided by @bpasero here:

#50280 (comment)

Then post your results as a comment here.

To make the checkbox checked and unchecked, see here:

https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists

@rebornix rebornix assigned rebornix and unassigned rebornix Sep 5, 2018
@masbaehr
Copy link

masbaehr commented Dec 28, 2018

Hi, some time passed, and i recently hit a memory with the latest 1.30.1 So there might be still some cases where it might happen... it was using all of the 16GB ram and kept swapping, which created a LOT of writes on a brand new SSD.

What we might have in common: I left a Java debugging session opened. So yea - i also think it's java related.

But maybe a generic solution for this problem should be added. For example a "hard crash" of VSCode in case memory hits 99%, so we can at least avoid extensive swapping.

@tovine
Copy link

tovine commented Jan 29, 2019

I too experienced this today, and while troubleshooting I came across this article: https://randomascii.wordpress.com/2018/02/11/zombie-processes-are-eating-your-memory/

Following that tip I enabled the 'handles' column in task manager and found one java.exe process holding about 100 times more handles than number 2 on the list (about 450k). After tracking down that it was a child process of VSCode, I closed one of my windows and witnessed the following drop in RAM consumption:
bilde

Note that VSCode itself wasn't listed as using more than a couple of hundred megabytes in the process list...

I usually leave my computer on for days (or weeks) at a time between reboots, and rarely restart VSCode.

Version: 1.30.2 (system setup)
Commit: 61122f8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17134

@rebornix
Copy link
Member

rebornix commented Jan 31, 2019

@tovine can you share the extensions you installed? I wonder if you install any Java extension. You can also run code --status in command line to see what process is using so much memory.

@tovine
Copy link

tovine commented Jan 31, 2019

@rebornix Here are the list of extensions installed (from code --list-extensions)
DavidAnson.vscode-markdownlint
eirikpre.systemverilog
ms-python.python
ms-vscode.cpptools
platformio.platformio-ide
qub.qub-xml-vscode
redhat.vscode-xml
sleutho.tcl
ZixuanWang.linkerscript

@tommai78101
Copy link

tommai78101 commented Jan 31, 2019

@tovine Run code --status when VS Code has high memory usage, and paste the output here. Don't kill any processes before then.

@tovine
Copy link

tovine commented Jan 31, 2019

I can't say for sure when (or if) it will happen again, but I will do that.

@shawmanz32na
Copy link
Author

shawmanz32na commented Jan 31, 2019

This still occurs constantly for me. Anytime I leave VS Code open for more than a day or two, I find myself in this situation. As a matter of fact, I'm in it at this very moment!

My list of extensions (from code --list-extensions:

EditorConfig.EditorConfig
joaompinto.asciidoctor-vscode
ms-vscode.PowerShell
PeterJausovec.vscode-docker
redhat.java
TomiTurtiainen.rf-intellisense
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
waderyan.gitblame

And the output of code --status, which shows that I have two VSCode windows open, each of which is gobbling memory:

Version:          Code 1.30.2 (61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8, 2019-01-07T22:54:13.295Z)
OS Version:       Windows_NT x64 10.0.17134
CPUs:             Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz (8 x 2694)
Memory (System):  31.93GB (1.21GB free)
VM:               0%
Screen Reader:    no
Process Argv:
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                enabled
                  video_decode:                 enabled
                  video_encode:                 enabled
                  webgl:                        enabled
                  webgl2:                       enabled
CPU %   Mem MB     PID  Process
    0       54   16048  code main
    0       57     856     gpu-process
    0       43    6288     shared-process
    0      183   26152     window (README.md - dss (Workspace) - Visual Studio Code)
    0       93    9968       extensionHost
    0      180   18504         "C:\Program Files\Java\jdk-11.0.1\bin\java" --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -jar C:\Users\KShaw\.vscode\extensions\redhat.java-0.37.0\server\plugins\org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar -configuration C:\Users\KShaw\.vscode\extensions\redhat.java-0.37.0\server\config_win -data c:\Users\KShaw\AppData\Roaming\Code\User\workspaceStorage\4403e5d1f9f0a177b8b5c0bf7e2a0517\redhat.java\jdt_ws
    0        0   22596           console-window-host (Windows internal process)
    0        3  778708           cmd /c "tasklist /FI "PID eq 9968" | findstr 9968"
    0        3  189928             findstr  9968
    0        9  267292             console-window-host (Windows internal process)
    0        7  685464             tasklist  /FI "PID eq 9968"
    0        1   55284         electron_node server.js
    0        1  443080         "C:\Users\KShaw\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\KShaw\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=9968
    0       14   24432       watcherService
    0        2  825408       C:\Windows\system32\cmd.exe /c start /wait C:\Windows\System32\cmd.exe
    0        4  429408         C:\Windows\System32\cmd.exe
    0       35  191884           electron_node cli.js
    0       53   30244             "C:\Users\KShaw\AppData\Local\Programs\Microsoft VS Code\Code.exe" --status
    0       30  700072               gpu-process
    0       14  725908           console-window-host (Windows internal process)
    0        9  947288         console-window-host (Windows internal process)
    0       40  706312     window (Preview README.md - soi-sdk-extensions - Visual Studio Code)
    0        1  730684       watcherService
    0        0   75724         console-window-host (Windows internal process)
    0        2  814348       extensionHost
    0       81  424304         "C:\Program Files\Java\jdk-11.0.1\bin\java" --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -jar C:\Users\KShaw\.vscode\extensions\redhat.java-0.37.0\server\plugins\org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar -configuration C:\Users\KShaw\.vscode\extensions\redhat.java-0.37.0\server\config_win -data c:\Users\KShaw\AppData\Roaming\Code\User\workspaceStorage\dd9fcf188c46c3519f38cc499e0c0235\redhat.java\jdt_ws
    0        0  735600           console-window-host (Windows internal process)
    0        3  854380     window (undefined)
Workspace Stats:
|  Window (README.md - dss (Workspace) - Visual Studio Code)
|  Window (Preview README.md - soi-sdk-extensions - Visual Studio Code)
|    Folder (dss-wiki): 145 files
|      File types: md(76) xml(20) svg(18) jpg(17) json(8) JPG(3) gitignore(1)
|                  png(1) tg(1)
|      Conf files:
|    Folder (dss-documentation): 222 files
|      File types: tex(83) def(28) csv(16) out(8) pdf(8) log(8) aux(8) sty(7)
|                  toc(7) lof(6)
|      Conf files:
|    Folder (soi-sdk-extensions): 32 files
|      File types: class(11) java(10) prefs(3) xml(2) classpath(1)
|                  gitignore(1) yml(1) project(1) md(1) json(1)
|      Conf files: settings.json(1)
|    Folder (dss): 1669 files
|      File types: jmod(420) so(144) md(133) class(74) java(58) properties(46)
|                  xml(43) h(42) policy(42) sh(32)
|      Conf files: launch.json(1) settings.json(1)
|      Launch Configs: java

Following @tovine's tip above, I can see that, indeed, there are a lot of handles...
image

If it helps, here's another printout of the information above after closing one of the two windows:

Version:          Code 1.30.2 (61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8, 2019-01-07T22:54:13.295Z)
OS Version:       Windows_NT x64 10.0.17134
CPUs:             Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz (8 x 2694)
Memory (System):  31.93GB (4.03GB free)
VM:               0%
Screen Reader:    no
Process Argv:
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                enabled
                  video_decode:                 enabled
                  video_encode:                 enabled
                  webgl:                        enabled
                  webgl2:                       enabled
CPU %   Mem MB     PID  Process
    0       53   16048  code main
    0       70     856     gpu-process
    0       44    6288     shared-process
    0      185   26152     window (README.md - dss (Workspace) - Visual Studio Code)
    0       58    9968       extensionHost
    0       24   18504         "C:\Program Files\Java\jdk-11.0.1\bin\java" --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -jar C:\Users\KShaw\.vscode\extensions\redhat.java-0.37.0\server\plugins\org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar -configuration C:\Users\KShaw\.vscode\extensions\redhat.java-0.37.0\server\config_win -data c:\Users\KShaw\AppData\Roaming\Code\User\workspaceStorage\4403e5d1f9f0a177b8b5c0bf7e2a0517\redhat.java\jdt_ws
    0        0   22596           console-window-host (Windows internal process)
    0        1   55284         electron_node server.js
    0        1  443080         "C:\Users\KShaw\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\KShaw\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=9968
    0       13   24432       watcherService
    0        2  825408       C:\Windows\system32\cmd.exe /c start /wait C:\Windows\System32\cmd.exe
    0        4  429408         C:\Windows\System32\cmd.exe
    0       14  725908           console-window-host (Windows internal process)
    0       35  941224           electron_node cli.js
    0       53  549968             "C:\Users\KShaw\AppData\Local\Programs\Microsoft VS Code\Code.exe" --status
    1       47  342484               gpu-process
    0        9  947288         console-window-host (Windows internal process)
Workspace Stats:
|  Window (README.md - dss (Workspace) - Visual Studio Code)
|    Folder (dss-wiki): 145 files
|      File types: md(76) xml(20) svg(18) jpg(17) json(8) JPG(3) gitignore(1)
|                  png(1) tg(1)
|      Conf files:
|    Folder (dss-documentation): 222 files
|      File types: tex(83) def(28) csv(16) pdf(8) out(8) log(8) aux(8) toc(7)
|                  sty(7) lot(6)
|      Conf files:
|    Folder (dss): 1669 files
|      File types: jmod(420) so(144) md(133) class(74) java(58) properties(46)
|                  xml(43) policy(42) h(42) sh(32)
|      Conf files: launch.json(1) settings.json(1)
|      Launch Configs: java

image

This clearly seems to point at something about vscode's use of java, but I'm not privy to anything more than that. I'll happily open an issue in a different project/repository, I just don't know which of them is appropriate. And even if that's the case, it seems as though VSCode should notice these runaway processes, or at least properly report its usage in the Windows Task Manager.

@tovine
Copy link

tovine commented Feb 6, 2019

@tovine Run code --status when VS Code has high memory usage, and paste the output here. Don't kill any processes before then.

It happened again now, here's the output:

Version:          Code 1.30.2 (61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8, 2019-01-07T22:54:13.295Z)
OS Version:       Windows_NT x64 10.0.17134
CPUs:             Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 3600)
Memory (System):  31.87GB (0.84GB free)
VM:               0%
Screen Reader:    no
Process Argv:
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                unavailable_software
                  video_decode:                 enabled
                  video_encode:                 enabled
                  webgl:                        enabled
                  webgl2:                       unavailable_off
CPU %   Mem MB     PID  Process
    1       34  364644  code main
    0       23  337132     shared-process
    0       60  357528     gpu-process
    0       15  370636     window (REDACTED - Visual Studio Code)
    0        1  359812       electron-crash-reporter
    0       26  374212       extensionHost
    0        1  114952         "C:\Program Files\Microsoft VS Code\Code.exe" "c:\Program Files\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=374212
    0        1  592272         c:\Users\tovine\.vscode\extensions\ms-vscode.cpptools-0.21.0\bin\Microsoft.VSCode.CPP.Extension.exe
    0        0  205176           console-window-host (Windows internal process)
    0        1  334828           c:\Users\tovine\.vscode\extensions\ms-vscode.cpptools-0.21.0/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 592272 0
    0        0  532744           c:\Users\tovine\.vscode\extensions\ms-vscode.cpptools-0.21.0/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 592272 17
    0        1  379384       watcherService
    2       50  376060     window (REDACTED - Visual Studio Code)
    0       13  366128       watcherService
    0       24  373972       extensionHost
    0        6  401716         "C:\Program Files\Java\jdk-11.0.1\bin\java" -noverify -Xmx64M -XX:+UseG1GC -XX:+UseStringDeduplication -jar C:\Users\tovine\.vscode\extensions\redhat.vscode-xml-0.3.0\server\org.eclipse.lsp4xml-uber.jar
    0        0  372248           console-window-host (Windows internal process)
    0        3  901188           cmd /c "tasklist /FI "PID eq 373972" | findstr 373972"
    0        9  870008             console-window-host (Windows internal process)
    0        3  888568             findstr  373972
    0        7  889108             tasklist  /FI "PID eq 373972"
    0       15  517076     window (REDACTED - Visual Studio Code)
    0        1  513012       watcherService
    0       11  519760       extensionHost
    0        0  490344         platformio -f -c vscode home --port 8011 --no-open
    0        0  519988           "c:\users\tovine\.platformio\penv\scripts\python.exe"  "C:\Users\tovine\.platformio\penv\Scripts\platformio.exe" -f -c vscode home --port 8011 --no-open
    0        0   48248             C:\Users\tovine\.platformio\packages\tool-pioplus\pioplus -f -c vscode home --port 8011 --no-open
    0        2   56768               c:\users\tovine\.platformio\penv\scripts\python.exe -c "import base64; exec(base64.b64decode('[TRUNCATED base64 string]...
    0        0  522612           console-window-host (Windows internal process)
    0        1  504416         c:\Users\tovine\.vscode\extensions\ms-vscode.cpptools-0.21.0\bin\Microsoft.VSCode.CPP.Extension.exe
    0        0  504772           console-window-host (Windows internal process)
    0        1  518312           c:\Users\tovine\.vscode\extensions\ms-vscode.cpptools-0.21.0/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.exe 504416 0
    0        1  788704         "C:\Program Files\Microsoft VS Code\Code.exe" "c:\Program Files\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=519760

Workspace Stats:
|  Window (REDACTED - Visual Studio Code)
|  Window (REDACTED - Visual Studio Code)
|  Window (REDACTED - Visual Studio Code)
|    Folder (REDACTED): more than 24659 files
|      File types: sv(3774) tcl(2685) txt(1047) args(927) sh(919) sim(898)
|                  fl(753) comp(697) gz(621) rpt(447)
|      Conf files: makefile(598) launch.json(2) settings.json(1)
|    Folder (REDACTED): 5913 files
|      File types: dita(3606) ditamap(709) svg(454) vsdx(188) list(154) r(113)
|                  param(68) md(58) git(54) xml(53)
|      Conf files: makefile(10)
|    Folder (REDACTED): 1850 files
|      File types: c(671) h(281) png(148) txt(113) s(79) gif(73) vsd(72)
|                  uvprojx(38) uvoptx(38) a(38)
|      Conf files: makefile(3)

That java.exe process running under vscode currently has about 623 400 handles active and total memory usage is 31.2GB, of which only ~9GB is displayed in the list of processes...

@rebornix
Copy link
Member

rebornix commented Feb 7, 2019

Based on the information provided above, the issue was caused by extensions using Java

@tovine you may want to file issues against redhat.vscode-xml

@shawmanz32na you may want to file issues against redhat.java

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests