Fix #42839. avoid ui freeze when file is larger than heap size limit.

This commit is contained in:
Peng Lyu
2018-02-05 17:22:26 -08:00
parent 9f5a4a2102
commit 50a1deb9f6
8 changed files with 64 additions and 11 deletions

View File

@@ -306,6 +306,13 @@ export async function main(argv: string[]): TPromise<any> {
});
}
if (args['js-flags']) {
const match = /max_old_space_size=(\d+)/g.exec(args['js-flags']);
if (match && !args['max_old_space_size']) {
argv.push(`--max_old_space_size=${match[1]}`);
}
}
const options = {
detached: true,
env