-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Description
Several times a day my team is experiencing vscode running away with the CPU on OSX requiring a force kill. This always happens with the CMake plugin running and after a configure operation. I finally captured the condition with the javascript debugger open and found that the method that was taking all of the time was this:
| private _checkTrim(): void { |
My Javascript skills are 20 years out of date so I'm not really sure what's going on with this typescript and some of the debugger behavours but when I poke at it I see this:
where the _canonicalUris size is already over 1M entries and growing and the _canonicalUris.clear() method seems to have no effect. This method keeps getting entered, 32,769 entires are removed, clear is called but has no effect on the size, newSize is calculated as 32,768, and the loop iterates 32,768 times which takes the majority of the CPU time observed. This continues until we manually kill it. The runtime appears to be exponential or the something terrible enough that even 5-10 minutes on my M2 max with 96GB or ram isn't enough time for the storm to clear.
I'm sure it's my ignorance but shouldn't https://github.com/microsoft/vscode/blame/main/src/vs/base/common/skipList.ts#L45 contain this._size = 0? Is that the core problem here?
I'm working with the latest release of vscode (although we've been suffering with this for several months now) on Mac os 13.5.2 running on an M2 Max with 96 GB of RAM.