microsoft / microsoft/vscode-cpptools

General Tag Parser memory issues, can I just disable it entirely?

Offen
#7,329 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug investigate: repro Language Service performance
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Type: LanguageService

Describe the bug

  • OS and Version: Kubuntu 20.04.2
  • VS Code Version: 1.55.1
  • C/C++ Extension Version: 1.2.2
  • Other extensions you installed (and if the issue persists after disabling them): GitLens, Docker, DeviceTree, Remote - Containers, Remote - SSH (did not disable any of these while testing)
  • Does this issue involve using SSH remote to run the extension on a remote machine?:
    I originally ran remote in a docker container, but have since only access the files outside of the container and still experience the issue.
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
    I have been having issues where my host system's memory usage slowly climbs until consuming all RAM and swap memory (that would be 64GB total). It is almost entirely the cpptools process, and if I don't catch it in time and kill it, it will lock up my system. The code base is a large linux system that supports multiple platforms and targets, with several kernel versions available depending on the target. I use this tool to build a compile_commands.json based on the build output, as my work is mostly kernel/driver layer. The issue seems primarily related to when the Tag Parser is in use (I have tried only using the Tag Parser, which was the worst, but now I seem to only observe it when IntelliSense is failing for some reason). I thought I had resolved it by only using IntelliSense with Tag Parser backup disabled, but when I opened this morning it informed me IntelliSense was unavailable (?) and it is using the Tag Parser (the memory usage is not as high yet, but is currently at 10.5GB and keeping fairly steady). Since starting to write this bug, the IntelliSense engine seems to have come back online and it is staying stable (although still at high memory usage seemingly mostly consumed by the Tag Parser).

Steps to reproduce

  1. Open large workspace (project described above)
  2. Either enable ONLY the Tag Parser, or encounter a situation where the "IntelliSense client is not available"
  3. Observe memory usage increase steadily
  4. Going to the definition of enough files seems to also make it worse (presumably spawning more parsing processes)

Expected behavior

Some amount of memory usage is understood to be necessary, even in the several GB. I would expect after using a certain amount of memory, it limits itself, even if that limits what features are available until it completes.
Most importantly, I expect the setting to explicitly NOT use the Tag Parser as a backup would prevent the Tag Parser from running when IntelliSense is not available. I would rather have nothing than eventual system lock up, although I'm unclear why the IntelliSense client would not be available in the first place (as reported by the C/C++ Output window when I have Debug set).

NOTE: any logs posted have been trimmed of any potential company IP. I included notes to describe what was there and seemed important from my perspective. If more information is necessary, we can try to figure out what I can/can't share there (might not even be necessary, just doing it out of an abundance of caution unless other information is actually useful).

Logs
-------- Diagnostics - 4/9/2021, 10:11:45 AM
Version: 1.2.2
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceRoot}/kmod/**",
        "${workspaceRoot}/software/libs",
        "${workspaceRoot}/toolchain/x86_64-linux-gnu/include/c++/7.5.0",
        "${workspaceRoot}/toolchain/x86_64-linux-gnu/include/c++/7.5.0/x86_64-linux-gnu",
        "${workspaceRoot}/toolchain/lib/gcc/x86_64-linux-gnu/7.5.0/include",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/include",
        "${workspaceRoot}/kernel/linux-4.19.25-rt16/include",
        "${workspaceRoot}/x86_64-linux-gnu/intevac/libs",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/dbus-1.0",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/dbus-1.0/include",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/libxml++-3.0",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/glibmm-2.4",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/glibmm-2.4/include/",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/glib-2.0",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/libxml++-3.0/include/",
        "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/glib-2.0/include/"
    ],
    "defines": [
        "QSC_CONFIG_AUDIO_ENGINE"
    ],
    "intelliSenseMode": "linux-gcc-x64",
    "compilerPath": "/usr/bin/g++",
    "cStandard": "c11",
    "cppStandard": "c++17",
    "compileCommands": "${workspaceFolder}/compile_commands.json",
    "compilerArgs": [],
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "compilerPathIsExplicit": true,
    "browse": {
        "path": [
            "${workspaceRoot}/kmod/**",
            "${workspaceRoot}/software/libs",
            "${workspaceRoot}/toolchain/x86_64-linux-gnu/include/c++/7.5.0",
            "${workspaceRoot}/toolchain/x86_64-linux-gnu/include/c++/7.5.0/x86_64-linux-gnu",
            "${workspaceRoot}/toolchain/lib/gcc/x86_64-linux-gnu/7.5.0/include",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/include",
            "${workspaceRoot}/kernel/linux-4.19.25-rt16/include",
            "${workspaceRoot}/x86_64-linux-gnu/intevac/libs",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/dbus-1.0",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/dbus-1.0/include",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/libxml++-3.0",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/glibmm-2.4",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/glibmm-2.4/include/",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/include/glib-2.0",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/libxml++-3.0/include/",
            "${workspaceRoot}/x86_64-linux-gnu/install/usr/lib/glib-2.0/include/",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ OMITTED PATH TO SINGLE IP SOURCE (C FILE) ]:
    OMITTED PATH TO SINGLE IP SOURCE (C FILE)
    OMITTED PATH TO SINGLE IP SOURCE (H FILE)
Translation Unit Configurations:
[ OMITTED PATH TO SINGLE IP SOURCE (C FILE) ]:
    Process ID: 1514214
    Memory Usage: 84 MB
    Compiler Path: /usr/bin/g++
    Includes:
    
NOTE: INCLUDE PATHS TRIMMED TO HIDE COMPANY IP
-- there were 35 include paths in this list, spanning our IP as well as source for a single kernel version

        /usr/lib/gcc/x86_64-linux-gnu/9/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Defines:
        __KERNEL__
        KASAN_SHADOW_SCALE_SHIFT=3
        KASAN_SHADOW_SCALE_SHIFT=3
        MODULE
        KBUILD_BASENAME="output"
        KBUILD_MODNAME="vst_controller"
    Forced Includes:
    
NOTE: INCLUDE PATHS TRIMMED TO HIDE COMPANY IP
-- there were 3 include paths in this list, spanning our IP as well as source for a single kernel version

    Standard Version: c11
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --gcc
        --gnu_version=90300
    compile_commands.json entry:
        directory: /home/qsysbuilder/qsys-develop
        file: <omitted>
        
NOTE: FILE BUILD OPTIONS TRIMMED TO HIDE COMPANY IP
-- it was used to pull the include paths 

Total Memory Usage: 84 MB
Browse Paths from compile_commands.json, from workspace folder: /home/james/qsys-develop

NOTE: BROWSE PATHS TRIMMED TO HIDE COMPANY IP
-- there were 1612 include paths in this list, spanning our IP as well as source for several kernel versions

------- Workspace parsing diagnostics -------
Number of folders and files enumerated: 1108129
Number of files discovered (not excluded): 429872
Number of files parsed: 39641

Screenshots

Additional context

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Speicherwachstum mit dem Tag Parser und dem IntelliSense-Fallback im beschriebenen großen Arbeitsbereich unter Verwendung der Konfiguration compile_commands.json und des Fensters C/C++ Output zu reproduzieren. Vergleiche das Verhalten bei deaktiviertem Tag Parser backup und ermittle, ob die Einstellung berücksichtigt wird, wenn IntelliSense nicht verfügbar ist; abgeschlossen ist die Aufgabe, wenn der Fehlermodus sowie das Verhalten mit begrenztem Speicher oder bei der Deaktivierung durch einen fokussierten Regressionstest abgedeckt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.