Skip to content

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

Merged
Peng Lyu (rebornix) merged 2 commits into
masterfrom
rebornix/largefile
Feb 14, 2018
Merged

Peng Lyu (rebornix) merged 2 commits into
masterfrom
rebornix/largefile

Conversation

@rebornix

@rebornix Peng Lyu (rebornix) commented Feb 6, 2018 •

Copy link
Copy Markdown
Contributor

We set the file size limit to 300MB (on 32bit) and 16GB (on 64bit) based memory optimization and analysis in #30180 . As described in #42839, v8 heap size limit is making this limit smaller on 64bit. In this PR, we check max_old_space_size first and if it's exceeding v8's limit, we show error message to users and ask them to run code --max_old_space_size={LARGERSIZE} to workaround.

alexandrudima Can we remove the general file size limit, as we are moving to the new buffer and v8 is the limit ?

cc Benjamin Pasero (@bpasero)

Comment thread src/main.js Outdated
function resolveJSFlags() {
let jsFlags = [];
if (args['js-flags']) {
jsFlags.push(args['js-flag']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peng Lyu (@rebornix) typo? js-flag vs js-flags

'--inspect-brk-extensions': localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection uri."),
'--disable-gpu': localize('disableGPU', "Disable GPU hardware acceleration."),
'--upload-logs': localize('uploadLogs', "Uploads logs from current session to a secure endpoint."),
'--max_old_space_size': localize('maxOldSpaceSize', "Max size of the old space (in Mbytes).")

@bpasero Benjamin Pasero (bpasero) Feb 6, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peng Lyu (@rebornix) this is a very technical description that no user will understand, I would not expose the V8 flag to the user but rather introduce a new CLI argument like "--max-memory", or possibly "--support-large-files"

@alexdima

Alexandru Dima (alexdima) commented Feb 6, 2018 •

Copy link
Copy Markdown
Member

Interesting, I didn't know about this limit built into v8 except for us using it in our gulp scripts.

Why should this be a command line flag exposed to the user? IMHO users would prefer large files to just work, and not have to read about the command line flag. IMHO we should simply set the value of the flag to a large number. I would suggest we also ask on the v8 mailing list why is that built-in default value so low, and what precisely are the consequences of raising it.

@rebornix

Copy link
Copy Markdown
Contributor Author

From v8 mailing list:

over time the heap size will tend to grow towards the limit. V8 likes
to grow the heap if it would otherwise have to scan it frequently; it
leaves more CPU time for useful work.

so we keep the default old_space_size_limit and change it when users open large files. The command line args will be named as --max-memory.

@rebornix
Peng Lyu (rebornix) merged commit 37ced1a into master Feb 14, 2018
@joaomoreno
João Moreno (joaomoreno) deleted the rebornix/largefile branch April 30, 2018 08:31
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants