VSCode - Nordic KConfig extension misbehaviour/excessive CPU/memory usage.

Problem - while working in a project where VSCode does not have visibility to the nRFConnect SDK folders, but where the project includes project-specific KConfig files, the KConfig extension seems to be misbehaving as follows:

  1. It throws an error into the VSCode output window every 1-2 minutes. This is annoying since it pulls focus from the terminal window even while one is actively interacting with the terminal). 
  2. It is using a massive amount of CPU and memory resources (causing computer to freeze pretty often). System monitor shows the underlying python process consuming anywhere from 1-2 GB of RAM at steady state, with spikes up to 5 GB. 

Disabling the extension makes all the performance issues disappear.

This issue seems to have popped up since either the latest version of VSCode or the latest version of the extension. I have had the extension installed for months before this with the same project configuration and have never had any issues.

The issue is seen on an ASUS laptop (ZenBook UX564EI_Q538EI, Intel i7-1165G7 @ 2.80GHz, 16GB RAM), running Linux (Pop!_OS 22.04 LTS).

VSCode version  info:
Version: 1.74.2
Commit: e8a3071ea4344d9d48ef8a4df2c097372b0c5161
Date: 2022-12-20T10:27:19.253Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 6.0.6-76060006-generic
Sandboxed: No

Extension version info: nRF Kconfig v2022.11.50

I am happy to provide any additional details to debug this issue. 

Parents
  • Hello, 

    Can you please provide the output of the extension command - nRF Connect: Generate Support Information as well?

    It throws an error into the VSCode output window every 1-2 minutes. This is annoying since it pulls focus from the terminal window even while one is actively interacting with the terminal). 

    What error does it throw?

    It is using a massive amount of CPU and memory resources (causing computer to freeze pretty often). System monitor shows the underlying python process consuming anywhere from 1-2 GB of RAM at steady state, with spikes up to 5 GB.

    What python process is this, are you able to provide more information?

    Thanks. 

    Kind regards,
    Øyvind

Reply
  • Hello, 

    Can you please provide the output of the extension command - nRF Connect: Generate Support Information as well?

    It throws an error into the VSCode output window every 1-2 minutes. This is annoying since it pulls focus from the terminal window even while one is actively interacting with the terminal). 

    What error does it throw?

    It is using a massive amount of CPU and memory resources (causing computer to freeze pretty often). System monitor shows the underlying python process consuming anywhere from 1-2 GB of RAM at steady state, with spikes up to 5 GB.

    What python process is this, are you able to provide more information?

    Thanks. 

    Kind regards,
    Øyvind

Children
  • Hello Øyvind, 

    Thank you for your quick response.

    I have re-enabled the Kconfig extension to reproduce the issue, but so far I have only partially reproduced it. At the moment, I see issue 1) (continuously throwing errors), but I do not see issue 2 (cpu/memory usage).

    Regardless, I am attaching the info you requested, as follows:

    1. A log of >2400 errors thrown over the course of a day
    2. The Generate Support Information output
    3. Screenshot of the python process that was using too much memory (and is currently working fine). 

    As soon as I reproduce the resource usage issue, I will add evidence of it.




     Kconfig_throwing_errors.txt

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "linux",
        "osVersion": "#202210290932~1669062050~22.04~d94609a SMP PREEMPT_DYNAMIC Mon N",
        "osKernel": "6.0.6-76060006-generic",
        "vscode": "1.74.2",
        "electron": "19.1.8",
        "node": "v16.14.2"
      },
      "system": {
        "date": "2023-01-06T15:01:17.616Z",
        "vscodeRoot": "/usr/share/code/resources/app",
        "nrfConnectForDesktopInstalled": "unknown",
        "vscodeUptime": "00:03:25",
        "osUptime": "760:15:17",
        "cpu": {
          "model": "11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz",
          "speed": "2870 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.33 GB",
          "free": "1.69 GB"
        }
      },
      "workspace": {
        "name": null,
        "workspaceFile": null,
        "folders": []
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.11.140",
            "path": "/home/zsilet/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.11.140-linux-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": null,
          "nordic-semiconductor.nrf-devicetree": null,
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2022.11.50",
            "path": "/home/zsilet/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.11.50",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.13.9",
          "ms-vscode.js-debug": "1.74.1",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.vscode-js-profile-table": "1.0.3",
          "alefragnani.Bookmarks": "13.3.1",
          "bbenoist.QML": "1.0.0",
          "cschlosser.doxdocgen": "1.4.0",
          "dracula-theme.theme-dracula": "2.24.2",
          "eamodio.gitlens": "13.2.0",
          "ev3dev.ev3dev-browser": "1.2.0",
          "flimberger.android-system-tools": "0.0.2",
          "foxundermoon.shell-format": "7.2.2",
          "justerest.multi-replace": "0.7.1",
          "marlinfirmware.auto-build": "2.1.45",
          "ms-azuretools.vscode-docker": "1.23.3",
          "ms-python.isort": "2022.8.0",
          "ms-python.python": "2022.20.1",
          "ms-python.vscode-pylance": "2023.1.10",
          "ms-toolsai.jupyter": "2022.11.1003412109",
          "ms-toolsai.vscode-jupyter-cell-tags": "0.1.6",
          "ms-toolsai.vscode-jupyter-slideshow": "0.1.5",
          "ms-vscode-remote.remote-containers": "0.266.1",
          "ms-vscode-remote.remote-ssh": "0.94.0",
          "ms-vscode-remote.vscode-remote-extensionpack": "0.23.0",
          "ms-vscode.cmake-tools": "1.12.27",
          "ms-vscode.powershell": "2022.12.1",
          "ms-vscode.remote-explorer": "0.0.3",
          "platformio.platformio-ide": "2.5.5",
          "redhat.java": "1.13.0",
          "streetsidesoftware.code-spell-checker": "2.12.0",
          "tibotix.definition-autocompletion": "1.1.8",
          "timonwong.shellcheck": "0.29.3",
          "tintinweb.vscode-inline-bookmarks": "0.1.0",
          "VisualStudioExptTeam.intellicode-api-usage-examples": "0.2.6",
          "VisualStudioExptTeam.vscodeintellicode": "1.2.29",
          "vscjava.vscode-java-debug": "0.47.0",
          "vscjava.vscode-java-dependency": "0.21.1",
          "vscjava.vscode-java-pack": "0.25.7",
          "vscjava.vscode-java-test": "0.37.1",
          "vscjava.vscode-maven": "0.40.2",
          "yrpark99.hidl-syntax": "0.0.2",
          "zxh404.vscode-proto3": "0.5.5"
        }
      },
      "tools": {},
      "sdks": [],
      "toolchains": [],
      "connectedDevices": [],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "",
          "toolchain": {
            "path": ""
          },
          "ozonePath": "",
          "applications": [],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig",
            "executeInDefaultShell": false
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true,
          "taskBindings": {},
          "debugging": {
            "backend": "nRF Debug",
            "flash": true,
            "bindings": {}
          },
          "activeAppFollowActiveEditor": true
        }
      },
      "environment": {
        "westExe": "west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/home/zsilet",
          "PATH": "/home/zsilet/.local/bin:/home/zsilet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/zsilet/.local/share/JetBrains/Toolbox/scripts",
          "GNUARMEMB_TOOLCHAIN_PATH": "/home/zsilet/projects/tools/gcc-arm-none-eabi/10.3-2021.07",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "zsilet"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/home/zsilet",
          "PATH": "/home/zsilet/.local/bin:/home/zsilet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/zsilet/.local/share/JetBrains/Toolbox/scripts",
          "GNUARMEMB_TOOLCHAIN_PATH": "/home/zsilet/projects/tools/gcc-arm-none-eabi/10.3-2021.07",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "zsilet"
        }
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }

  • Are you able to provide some more information on this topic? We are not able to reproduce at the moment. 

    Are you using workspaces actively, i.e. configuring workspace for NCS ? What did you configure the nRF Connect for VS Code extension too (under "open welcome page")

    Problem - while working in a project where VSCode does not have visibility to the nRFConnect SDK folders, but where the project includes project-specific KConfig files, the KConfig extension seems to be misbehaving as follows:

    Is this a freestanding project, which is in a different folder? For example in my setup I have:

    /home/oysa/NCS/v2.2.0

    And my projects are found in e.g.

    /home/oysa/Projects/

    Also, from the the support information you have provided I can see that there is no SDK configured. 

  • Hello Øyvind, 

    First off, I understand that your time is valuable, I appreciate your support, so I want to be clear that, for some reason, I am unable to reproduce the issue at this point (ever since I disabled and re-enabled the extension). I will report back as soon as I reproduce it again. 

    To answer your questions:

    1. Yes, this is a freestanding project.
      1. This project does not rely on ANY local nrfconnect SDK files.
      2. This project is not opened through the nRFconnect extension.
      3. This project is being built via a docker instance.
        1. The project folder gets mounted to the docker instance,
        2. The necessary SDK files and tools are all part of the docker image. 
        3. The build directory structure is created by docker, but is located on the local file system (project_folder/build). 
    2. I have the nRFConnect extension installed for other (local) work, mainly to be able to compile/run samples. I also have the nRFConnect SDK installed locally for the same purpose. 

    My project has its own KConfig file, and includes a custom board definition and custom drivers I wrote which have their own KConfig files. The build output on the other hand has paths that reflect the folder hierarchy that docker sees (see 1.c.C above). This in turn explains why the locak KConfig extension reports " No such file or directory: '/home/docker/sdk/zephyr/Kconfig' not found. This in itself is NOT a problem. The problem is simply that the extension seems to be getting stuck in a loop reporting the error and bogging down my system. 
     

  • Hi, thanks for providing this information. 

    Zsilet said:
    I appreciate your support, so I want to be clear that, for some reason, I am unable to reproduce the issue at this point (ever since I disabled and re-enabled the extension). I will report back as soon as I reproduce it again. 

    Thank you, and nothing to worry about. This is something we often see. Let's not close this ticket yet, and when you are able to reproduce just respond to this ticket. 

    Zsilet said:
    This project is being built via a docker instance

    I will have a chat with the R&D people who are using Docker as well to see if they have any input. 

    Kind regards,
    Øyvind

  • Hello Øyvind, 

    The issue started happening again today (since 9:22AM when I booted my machine and started VScode, it has now been erroring for more than 6.5 hrs).

    The memory consumption is not as bad as it was when I first saw it, but it's still significant. 

    I have included the VSCode output logs and a screenshot of the python script's process profile. 

    Kconfig_throwing_errors_02062023.txt


     

Related