Skip to content

macOS: High CPU Usage (looping update_file_if_needed) #8124

Description

Bug type: Language Service

Describe the bug

  • OS and Version:
    Screen Shot 2021-09-09 at 11 00 41 am
  • VS Code Version:
    Screen Shot 2021-09-09 at 11 00 56 am
  • C/C++ Extension Version:
    v1.6.0

Sometime after starting vscode, the cpptools process will jump to 100% CPU usage and stay there until the windows is reloaded.
The project is for embedded devices, and is therefore using a cross-compiler (arm-none-eabi-gcc). Intellisense configuration is through an autogenerated compile_commands.json. The project is based on Zephyr RTOS (https://github.com/zephyrproject-rtos/zephyr). The root folder (ignoring compiler headers) is approximately 40k files.

Code sample and logs

  • Configurations in c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Zephyr",
            "cStandard": "c99",
            "compilerPath": "/Users/<user>/code/gcc-arm-none-eabi/bin/arm-none-eabi-gcc",
            "intelliSenseMode": "gcc-x64",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json",
            "includePath": [
                "zephyr/include",
                "${workspaceFolder}/build/zephyr/include/generated"
            ]
        }
    ],
    "version": 4
}
  • Logs from running C/C++: Log Diagnostics from the VS Code command palette
    "C_Cpp.loggingLevel": "7",
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/x86/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/arm64/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/arm/aarch32/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/arc/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/nios2/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/riscv/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/xtensa/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/posix/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/sparc/arch.h
  Same time stamp: 1630475297

Over a minute or so of just watching the logs, there were approximately 400 thousand lines like the above.
Not all files were being checked. Files that were checked were checked about 80 times each.

Additional context

Call stack of cpptools process.

Screen Shot 2021-09-09 at 11 01 50 am

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions