-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Description
Does this issue occur when all extensions are disabled?: No
- VS Code Version: In VSCode with Remote SSH extension , Or Code Server
- OS Version: Connecting Windows to the Linux Server
Phenomenon
The VS Code Server with Remote SSH extension or Code Server experiences a memory leak issue
vscode/src/vs/base/parts/ipc/node/ipc.net.ts
Line 646 in 921f7ca
| private readonly _recordedInflateBytes: VSBuffer[] = []; |
The length of the array '_recordedInflateBytes' only grows over time and is not released unless the entry process is closed.
The snapshot information is as follows:
PersistentProtocol <- src\vs\base\parts\ipc\common\ipc.net.ts
_socket: WebSocketNodeSocket ->
_flowManager:WebSocketFlowManager ->
_zlibInflateStream: ZlibInflateStream ->
_recordedInflateBytes: VSBuffer[] -> The length of the array only grows with time (65411 items in heapsnap shot)
Steps to Reproduce:
-
In VSCode version 1.94.2 with Remote SSH extension ,
-
disable the 'Use Exec server' option to switch the VSCode server to a WebSocket connection type to reproduce the issue.
-
Wait for one week and check the entry process.
-
Code Server.
-
Wait for one week and check the entry process.
Thought:
The recording of inflated bytes results in a memory leak. The Recording inflated bytes is not necessary if the socket will not be sent to ExtensionHost process. The solution is to disable sending the socket to the ExtensionHost process and as a result, the need to write inflated bytes is eliminated. A named pipe can be used to communicate with the ExtensionHost instead of sending a socket.
| this._canSendSocket = (!isWindows || !this._environmentService.args['socket-path']); |
the “_canSendSocket” property is always true for non-Windows platforms. The named pipe is only used on Windows. Are there any problems or concerns?


