wix / import-cost

displays the import size of the package you are importing inside the code editor
https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost
MIT License
1.36k stars 68 forks source link

Memory leak #35

Closed mxschmitt closed 2 years ago

mxschmitt commented 7 years ago

From @maxibanki on October 31, 2017 0:13

Extension Author (truncated) Version
markdown-checkbox bie 0.0.3
jshint dba 0.10.15
vscode-eslint dba 1.4.0
githistory don 0.2.3
xml Dot 1.9.2
gitlens eam 5.7.1
tslint eg2 1.0.14
vscode-abap lar 0.1.0
Go luk 0.6.66
postscript max 1.0.0
code-beautifier mic 1.7.2
debugger-for-chrome msj 3.4.0
vetur oct 0.10.1
vscode-docker Pet 0.0.20
vscode-icons rob 7.17.0
vscode-table-formatter shu 1.2.1
vscode-hexdump sle 1.6.0
addDocComments ste 0.0.8
html-preview-vscode tht 0.1.1
vscode-import-cost wix 2.5.1

(1 theme extensions excluded)


Steps to Reproduce: (not reproduceable)

  1. Open Vetur settings
  2. Click on contributions

Reproduces without extensions: Yes/No

Processes: procexp64_2017-10-31_00-36-29 Command line: "C:\Programme\VSCodeInsider\Code - Insiders.exe" C:\Users\mxs\.vscode-insiders\extensions\wix.vscode-import-cost-2.5.1\node_modules\worker-farm\lib\child\index.js "C:\Programme\VSCodeInsider\Code - Insiders.exe" c:\Programme\VSCodeInsider\resources\app\out\bootstrap --type=extensionHost Process Explorer Performance Tab: procexp64_2017-10-31_00-42-11

Hi,

I'm not so familiar with the process structure of VS Code, but in the command line arguments of the process which used so much RAM, there is the extension wix.vscode-import-cost-2.5.1 loading. Could this process used only for this extension, so that this is the cause of the high memory usage?

I tried to run the Dev Tools Performance Profiler, but it never finished, because of the always 100% usage of my memory in my notebook I think.

Best regards

Copied from original issue: Microsoft/vscode#37192

mxschmitt commented 7 years ago

Again the same problem now with these details:

Extension Author (truncated) Version
markdown-checkbox bie 0.0.3
jshint dba 0.10.15
vscode-eslint dba 1.4.0
githistory don 0.2.3
xml Dot 1.9.2
gitlens eam 5.7.1
tslint eg2 1.0.14
vscode-abap lar 0.1.0
Go luk 0.6.66
postscript max 1.0.0
code-beautifier mic 1.7.2
debugger-for-chrome msj 3.4.0
vscode-docker Pet 0.0.20
vscode-icons rob 7.17.0
vscode-table-formatter shu 1.2.1
addDocComments ste 0.0.8
html-preview-vscode tht 0.1.1

The processes with the high memory usage are again started with these parameters. "C:\Programme\VSCodeInsider\Code - Insiders.exe" C:\Users\mxs\.vscode-insiders\extensions\wix.vscode-import-cost-2.5.1\node_modules\worker-farm\lib\child\index.js "C:\Programme\VSCodeInsider\Code - Insiders.exe" c:\Programme\VSCodeInsider\resources\app\out\bootstrap --type=extensionHost

Now I removed the wix.vscode-import-cost-2.5.1 extension, to see if the memory leak again occurs.

mxschmitt commented 7 years ago

From @AngeloCicero on October 31, 2017 15:22

I had to stop using VSCode for the past few days because after using it for a while for Vue development (with Vetur of course), my entire computer seems to lock up and cannot even access the internet. Thanks for the investigation, I thought I was crazy.

mxschmitt commented 7 years ago

Hi Angelo, In the first test I had Vetur installed, and on the second not, because I thought this was the course. Now I'm thinking more and more that it's the fault of the wix.vscode-import-cost extension.

mxschmitt commented 7 years ago

From @AngeloCicero on October 31, 2017 17:0

@maxibanki Ah ok, coincidence I guess. The only other extension I am also using is vscode-eslint.

mxschmitt commented 7 years ago

From @octref on October 31, 2017 22:51

I don't really use that extension, but it seems it analyzes whatever file that's open? https://github.com/wix/import-cost/issues/18

Does it happen if you disable vscode-import-cost extension?

mxschmitt commented 7 years ago

Hi, I've been using it about 6-12 hours now without this extension. There were no problems, so it seems that the extension is the reason for the memory leak.

mxschmitt commented 7 years ago

From @octref on November 1, 2017 21:11

In that case, I suggest you open an issue for import-cost or disable it.

Roilan commented 7 years ago

Had to remove this plugin because of the memory leak and causing lock ups.

ulrikstrid commented 7 years ago

It seems there are a lot of "worker-farm" children running when we're using this extension. Would it be possible to spin them down and just check for changes and then spin them up again when new imports are added? I love this plugin but my 16GB is not enough to run it.

timnovis commented 6 years ago

I really love this plugin but it was using 1.5GB of memory, which I can't really live with!

shahata commented 6 years ago

@maxibanki does this still reproduce?

AhmadMayo commented 6 years ago

@shahata yes

VSCode Version: 1.20.1 OS Version: Ubuntu 17.10 Import Cost Version: 2.6.2 (why does the change log stops at 2.5.1 ?)

The extension was consuming 90-100% CPU and about 3 GB RAM, so I uninstalled it, closed vs code, killed the processes manually from the monitor because they didn't stop, then I opened vscode again and everything was normal. I love the extension - great job BTW, I really love it - so I installed again to give it a shot. At first everything was fine, but after about an hour I found out it was consuming more than 1.5 GB RAM - the cpu was normal though.

The first (891 MiB), second (877 MiB) and forth (168 MiB) vscode processes are import cost's - the third is something else - screenshot from 2018-03-07 01-45-44

trueter commented 6 years ago

Installed the plugin a couple of days ago and sadly have to remove it for the aforementioned reasons. I'm making extensive use of webpack aliases, which never seem to resolve. Maybe that helps.

6feferonka9 commented 6 years ago

This is still a BIG problem, i have to give up on this extension.

asztal commented 6 years ago

https://github.com/wix/import-cost/blob/master/packages/vscode-import-cost/src/extension.ts#L24 https://github.com/wix/import-cost/blob/master/packages/vscode-import-cost/src/decorator.ts#L4

It looks like keys are never removed from these objects after closing a document. I don't know how much impact that would have, though.

ghm-tutela commented 6 years ago

Make sure your system's set up to accept REISUB signals before you install this. Entire OS went unresponsive for 5 minutes while it calculated a webpack plugin's bundle size. Didn't have Sysrq keys on, but luckily the kernel killed it at 4.5 GB of memory.

[24898.616265] Out of memory: Kill process 14479 (code) score 453 or sacrifice child
[24898.616297] Killed process 14479 (code) total-vm:2224564kB, anon-rss:1216936kB, file-rss:0kB, shmem-rss:0kB
...
[25012.969554] Out of memory: Kill process 15163 (code) score 456 or sacrifice child
[25012.969575] Killed process 15163 (code) total-vm:2167964kB, anon-rss:1246640kB, file-rss:0kB, shmem-rss:0kB
yairhaimo commented 6 years ago

Can you please recheck with version 2.11.0?

sreetamdas commented 4 years ago

This is still occuring, going up to 1.2GB in my case. Is there any solution/hotfix for it?

diogotcorreia commented 4 years ago

image

This is this extension consuming 10GB of RAM on VSCode WSL Windows 10 1909. I'll have to give up on it.

jdeniau commented 4 years ago

image Same here with 2.12, huge memory consumption ;)

shahata commented 2 years ago

plz see if this is resolved in the new version which was just release (3.1.0), let me know if you still see the issue