mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Default maxTsServerMemory to 3GB
This commit is contained in:
parent
2a46387970
commit
693ffb4d57
|
@ -688,7 +688,7 @@
|
|||
},
|
||||
"typescript.tsserver.maxTsServerMemory": {
|
||||
"type": "number",
|
||||
"default": 0,
|
||||
"default": 3072,
|
||||
"description": "%configuration.tsserver.maxTsServerMemory%",
|
||||
"scope": "window"
|
||||
}
|
||||
|
|
|
@ -151,10 +151,12 @@ export class TypeScriptServiceConfiguration {
|
|||
}
|
||||
|
||||
private static readMaxTsServerMemory(configuration: vscode.WorkspaceConfiguration): number {
|
||||
const memoryInMB = configuration.get<number>('typescript.tsserver.maxTsServerMemory', 0);
|
||||
if (!Number.isSafeInteger(memoryInMB) || memoryInMB < 128) {
|
||||
return 0;
|
||||
const defaultMaxMemory = 3072;
|
||||
const minimumMaxMemory = 128;
|
||||
const memoryInMB = configuration.get<number>('typescript.tsserver.maxTsServerMemory', defaultMaxMemory);
|
||||
if (!Number.isSafeInteger(memoryInMB)) {
|
||||
return defaultMaxMemory;
|
||||
}
|
||||
return memoryInMB;
|
||||
return Math.max(memoryInMB, minimumMaxMemory);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue