-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window freeze when receiving lots of output (renderer) #12265
Comments
Couldn't reproduce with a long-running task with lots of output on both OSX and Windows 10. It looks like the large amount of output did slow things down though. The fact that the task runs for a long time shouldn't cause any of this. @StefH Could you paste your tasks.json for comparison? Thanks. |
tasks.json {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "mvn",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "clean"
},
{
"taskName": "compile",
"args": [
"clean",
"install"
],
"isBuildCommand": true
},
{
"taskName": "test"
},
{
"taskName": "package"
},
{
"taskName": "verify"
}
]
} |
Related to #7353 |
This is actually a problem of the output window. Moving to @isidorn. |
I saw the same behavior last week when enabling typescript server tracing which writes a lot of output. In this setup no tasks are involved. |
September to investigate |
@dbaeumer can you please share your reproducable steps since I do not want to setup java in order to investigate this. How to setup typescript server tracing and how to get that huge amount of output? Thanks! |
Settings: {
"typescript.tsserver.trace": "verbose"
} Open content assist quite frequently in a project that has a browser environment. |
I am not convinced that this is an issue with the output panel. I rather believe this is an issue with the extension host pumping data to the renderer and then getting stuck. I have test cases that produce the freeze when run from an extension and no freeze when run within the workbench: Freeze from Extension (simple hello world extension with hello world command): 'use strict';
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
vscode.window.showInformationMessage('Crashing!');
const outputChannel = vscode.window.createOutputChannel("Test");
outputChannel.show();
lotsOfOutput(outputChannel);
});
context.subscriptions.push(disposable);
}
var max = 10000;
var i = 0;
function lotsOfOutput(outputChannel) {
setTimeout(() => {
outputChannel.appendLine(`[Trace - 9:21:49 AM] Sending request: quickinfo (89). Response expected: yes. Current queue length: 0
Arguments: {
"file": "c:\\Users\\bpasero\\Desktop\\test-ts\\src\\extension.ts",
"line": 8,
"offset": 17
}`);
i++;
if (i < max)
lotsOfOutput(outputChannel);
}, 1);
} No Freeze within Workbench (for testing purposes change the export class CloseEditorAction extends Action {
public static ID = 'workbench.action.closeActiveEditor';
public static LABEL = nls.localize('closeActiveEditor', "Close Editor");
constructor(
id: string,
label: string,
@IOutputService private outputService: IOutputService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService
) {
super(id, label);
}
public run(): TPromise<any> {
const channel = this.outputService.getChannel("foo");
channel.show();
lotsOfOutput(channel);
return TPromise.as(false);
}
private appendOutput(channel): void {
}
}
var max = 10000;
var i = 0;
function lotsOfOutput(outputChannel) {
setTimeout(() => {
outputChannel.append(`[Trace - 9:21:49 AM] Sending request: quickinfo (89). Response expected: yes. Current queue length: 0
Arguments: {
"file": "c:\\Users\\bpasero\\Desktop\\test-ts\\src\\extension.ts",
"line": 8,
"offset": 17
}`);
i++;
if (i < max)
lotsOfOutput(outputChannel);
}, 1);
} Adding @jrieken to the thread. I wonder if the direct call to append is too aggressive and needs some buffering. |
Also - if many messages are being send, a warning should be printed |
@jrieken yup, @dbaeumer filed a similar issue and I merged it here. see #12265 (comment) Bottom line is that the TS extension can produce lots of output when the tracing option is turned on and this output is being send from the extension host. |
Btw I am on Windows 10 and see this, did not try on Mac. I am also scrolling in the output when this happens. The process monitor shows no activity when this happens, so it is not stuck in high CPU or high memory. |
45% of the time is spend in the |
So, I don't believe this is an issue specific to the extension host (albeit some more buffering could happen) but I see that most work is being spend in the parts outlined above. |
@jrieken can you reproduce the freeze? is this profile from running from extension host or main side? |
Also I am not convinced this issue can be tracked down by profiling: When VSCode freezes, there is no high CPU activity nor memory pressure. |
@bpasero It is very slow and 'yes' this is the main side (OutputService, string-utils etc). |
Ok lets keep this item to look into the performance on the renderer side and #6737 to check for the extension side. |
For October to investigate if we can make this faster when lots of output is received. Moving since it is not a regression from previous milestones. |
@bpasero looked in the output and there is nothing obvious to improve. AFAIK the slowness comes from nodejs/node#7657 as you pointed out in a different issue. |
Steps to Reproduce:
maven clean install
as task commandYou get an error message like:
When you wait until Maven is finished running all the tests, the VS Code windows are completely blocked.
Is there a way to increase the time-out from the
OUTPUT
window?The text was updated successfully, but these errors were encountered: