vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Microsoft.VSCode.CPP.Extension.darwin pegging CPU for hours on end

Open DevSecTim opened this issue 10 years ago • 77 comments

Any reason why this happens? My Mac fan is going all the time while using VSCode and its annoying and hot! Surely IntelliSight (or whatever) doesn't constantly need to scan code?

screen shot 2016-10-13 at 23 04 04

DevSecTim avatar Oct 13 '16 22:10 DevSecTim

0.17.4 seems to be normal, i need observer a time to check it.

Lingdu0 avatar Jun 01 '18 02:06 Lingdu0

Seems to be fixed for me with 0.17.4 - not noticed any high CPU usage. Thank you.

rhuanjl avatar Jun 01 '18 22:06 rhuanjl

I am still seeing 100% CPU issue with

C/C++ IntelliSense 0.17.4
VScode 1.24
OS Linux 4.13.0-39-generic #44~16.04.1-Ubuntu

louzhao8712 avatar Jun 18 '18 23:06 louzhao8712

@louzhao8712 100% CPU can be caused by different things, some intentional -- it's better if you open a new bug with repro details. What process is using the CPU? Is there a database symbol in the bottom right? Does it repro before you open any C++ file?

sean-mcmanus avatar Jun 18 '18 23:06 sean-mcmanus

Just go to /Users/"Your Username"/.vscode/extensions/ms-vscode.cpptools"Your Version"/bin/ (find your extension folder on your OS if you are not on mac) delete "Microsoft.VSCode.CPP.Extension.darwin" and create an empty txt file with the same name. Restart vscode and cpu usage is gone, One feature is gone too, but you won't even notice probably.

GeorgeBComan avatar Jul 08 '18 21:07 GeorgeBComan

@GeorgeBComan that turns off pretty much everything but the debugger support. If you would like to have a setting that does this for you, I recommend upvoting #785

bobbrow avatar Jul 09 '18 15:07 bobbrow

@bobbrow I stil have suggestions, at least that's what I remember, I'll try today and come back with an answer

GeorgeBComan avatar Jul 10 '18 13:07 GeorgeBComan

VS Code will always try to pop up suggestions even without our extension installed. Take a look at the "editor.quickSuggestions" and "editor.wordBasedSuggestions" settings if you want to turn that off entirely.

bobbrow avatar Jul 10 '18 16:07 bobbrow

macOS 10.12, Code 1.24.1 (just updated to 1.25.0, but don't think it's gonna help), C/C++ plugin 0.17.6: screen shot 2018-07-11 at 14 17 27

witaly-iwanow avatar Jul 11 '18 07:07 witaly-iwanow

@bobbrow The way you are doing it is better, I just disabled whtever was causing the cpu usage. Thank you

GeorgeBComan avatar Jul 11 '18 16:07 GeorgeBComan

@witaly-iwanow This appears to be bug https://github.com/Microsoft/vscode-cpptools/issues/2225, if you don't have a folder open (otherwise, it would be another bug, which we would need a repro or call stack).

sean-mcmanus avatar Jul 11 '18 19:07 sean-mcmanus

as for version 18.01 having problem with 99% of cpu utilization

prolands avatar Aug 31 '18 14:08 prolands

@prolands We need more info in order to diagnose/fix the issue, preferably in a different issue.

sean-mcmanus avatar Aug 31 '18 18:08 sean-mcmanus

@sean-mcmanus do you need any specific information? in general I have medium sized project with coupe of hundreds files nothing special I even not edit this just open and I have constant cpu load 100% for hours it simple never stops hogging cpu (the only way to stop it is kill the process) This behaviour reproducible in 100% cases. ------ this list of open files from process monitor txt /Users/user/.vscode/extensions/ms-vscode.cpptools-0.18.1/bin/Microsoft.VSCode.CPP.Extension.darwin txt /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-shm txt /usr/lib/dyld txt /private/var/db/dyld/dyld_shared_cache_x86_64h 0 ->0x444751117c49d0c5 1 ->0x444751117c49c69d 2 /dev/null 3 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db 4 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-wal 5 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-shm 6 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db 7 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db 8 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-wal 9 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-wal 10 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db 11 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-wal 12 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db 13 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-wal 14 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db 15 /Users/user/Library/Application Support/Code/User/workspaceStorage/a28d2dbfc4726251940680acd9ac5a74/ms-vscode.cpptools/.browse.VC.db-wal 16 ->0x44475111a0129d9d 17 ->0x44475111a012b59d 18 ->0x44475111a012ac9d 19 ->0x44475111a012985d 20 ->0x44475111a012b71d 21 ->0x44475111a012ba1d 22 /private/tmp/pipe_server_request_9219_0 23 /private/tmp/pipe_client_request_9219_0 24 /private/tmp/pipe_server_response_9219_0 25 /private/tmp/pipe_client_response_9219_0 30 /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar 36 ->0x444751117c49cc15

prolands avatar Sep 18 '18 09:09 prolands

@prolands That sounds like a bug. We haven't seen reports like that before. A couple hundred files is small and shouldn't use so much CPU. It could be stuck in some infinite loop. Can you attach a debugger (such as VS Code) to get the call stack for threads that appear to be doing work and not blocked? Or use some sort of Mac core dump or tracing tool to get call stacks? You can also try setting the C_Cpp.loggingLevel to "Debug" to see if there's anything unusual, or to the hidden value of "7" if that doesn't work.

sean-mcmanus avatar Sep 18 '18 18:09 sean-mcmanus

@sean-mcmanus this is recurring again on v0.19.0, shall I open a new issue or post diagnostics here?

jamesadevine avatar Oct 04 '18 09:10 jamesadevine

@jamesadevine Please open a new issue with more info, preferably attaching a debugger with a call stack for the threads that appear to be doing work. General things like crashes, freezes, and excessive CPU usage are symptoms and the root bugs are often different.

sean-mcmanus avatar Oct 04 '18 18:10 sean-mcmanus