I'm working on Ubuntu and using MS Remote SSH as part of Remote Explorer through VSCode. When I installed C/C++ (ms-vscode.cpptools) extension, it takes up a ton of CPU%, typically around 95. I thought perhaps this is a one time thing, but it's constantly running at that percentage, making everything else (compiling the project) very slow.
I like the functionality of this extension, as I've used it on other machines before without issue. However I can't use it if it's staying at that level of usage. Is there any workaround for this? I've seen a few github debates, but nothing much coming from those.
From system monitor:
After trying lots of solutions, only one works for me - adding files.exclude
in settings file.
When adding files.exclude
, the following lines will be add by default:
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.deps": true,
"**/CVS": true,
"**/.DS_Store": true,
then I add some files/folder, which are in workspace but they have nothing to do with IntelliSense, such as "**/*.Po", folder that stores test data (lots of files...), which are always been updated when I use my application, etc.
and I also add
"/bin": true,
"/boot": true,
"/cdrom": true,
"/dev": true,
"/proc": true,
"/etc":true
, but I am not sure if those lines help.
After updating the settings file, we should Restart IntelliSense for Active File
and Reset IntelliSense Database
by the Command Palette.
btw, after using the above solution, I haven't encountered long-running high CPU usage for over two months.
I have set C_Cpp.files.exclude
to exclude everything and then set explicit include paths in c_cpp_properties.json
and it seems to work fine. It does not keep scanning files anymore and resolves symbols correctly.
My settings.json
{
"C_Cpp.files.exclude": {
"**/.vscode": true,
"**/.vs": true,
"/": true
}
}
Example c_cpp_properties.json
:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/include/**"
"${workspaceFolder}/src/**"
],
"compilerPath": "/usr/bin/clang-14",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-clang-x64",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With