microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

Crash because server out of heap memory #3670

Open mortenfc opened 6 months ago

mortenfc commented 6 months ago

Brief Issue Summary

Vscode node server runs out of heap for extension in wsl connection when building with cmake tools

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.87.1",
  "cmtVersion": "1.17.17",
  "configurations": [
    {
      "folder": "/home/mfjordchris/repos/microsar-adaptive-2",
      "cmakeVersion": "3.27.0",
      "configured": true,
      "generator": "Unix Makefiles",
      "usesPresets": true,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[build] /usr/bin/cmake -E cmake_progress_start /home/mfjordchris/repos/microsar-adaptive-2/build/gcc7_linux_x86_64/CMakeFiles 0
[build] gmake[1]: Leaving directory '/home/mfjordchris/repos/microsar-adaptive-2/build/gcc7_linux_x86_64'
[build]
[driver] Build completed: 00:00:01.123
[build] Build finished with exit code 0

And then hangs until reload

Additional Information

From server window:

2024-03-27 17:29:40.633 [info] [127.0.0.1][40f1821a][ExtensionHostConnection] The client has reconnected. 2024-03-27 17:30:00.831 [info] [127.0.0.1][40f1821a][ExtensionHostConnection] The client has reconnected. 2024-03-27 17:30:12.434 [info] [127.0.0.1][40f1821a][ExtensionHostConnection] <10964> <--- Last few GCs --->

[10964:0x6f702f0] 293281 ms: Mark-sweep 4036.4 (4128.5) -> 4020.4 (4129.0) MB, 1071.7 / 0.0 ms (average mu = 0.151, current mu = 0.039) allocation failure; scavenge might not succeed [10964:0x6f702f0] 294294 ms: Mark-sweep 4036.2 (4129.0) -> 4021.4 (4129.0) MB, 1008.3 / 0.0 ms (average mu = 0.085, current mu = 0.005) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

gcampbell-msft commented 6 months ago

@mortenfc Could you set the CMake Tools logging to trace and then try again? This could possibly help us get useful information