-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Closed
Labels
freeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insidersworkspace-edit
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.65.2 (6b74534)
- OS Version: Ubuntu 20.04.3 LTS
This issue is acutally discovered in https://github.com/coder/code-server, but I found that the root cause is from the upstream vscode, so I am submitting the issue here.
Steps to Reproduce:
- Open a vscode window in the browser.
- Try to delete a large file (>100MB)
- The deletion takes a long time, or the tab is killed by OOM.
The cause I found is that when deleting a file, vscode keeps the file content into memory to support undo operation, only if the file is not too large. But in the code, vscode read the file content unconditionally at first and then discards it if exceeds the size limit.
vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts
Lines 251 to 261 in 6b74534
| let fileContent: IFileContent | undefined; | |
| if (!edit.undoesCreate && !edit.options.folder) { | |
| try { | |
| fileContent = await this._fileService.readFile(edit.oldUri); | |
| } catch (err) { | |
| this._logService.critical(err); | |
| } | |
| } | |
| if (!(typeof edit.options.maxSize === 'number' && fileContent && (fileContent?.size > edit.options.maxSize))) { | |
| undoes.push(new CreateEdit(edit.oldUri, edit.options, fileContent?.value)); | |
| } |
Related issues from code-server
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
freeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insidersworkspace-edit