You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Heap size on node 12 defaults to 1.4G. This is causing issues with our webpack build. Setting max-old-space-size to 2Gb solves the issue. Since we are already using 1.4Gb, raising to 2Gb shouldnt be an issue
ljewalsh
changed the title
Add information about setting NODE_OPTIONS for ui when webpack throws memory error to README
Add information about setting NODE_OPTIONS when webpack throws memory error
Jan 30, 2020
From what I can gather, the default value for max-old-space-size is 512 MB and if there's no downside to beefing it up to 2 GB I would rather set this directly as the default in apps/ui/Dockerfile. I don't want to end up with a README full of "if you have problem X, try solution Y" if setting sane defaults fix the problem for everyone.
@LucianBuzzo We would hit problems if we set max-old-space-size too high, but we wouldn't be able to run Jellyfish on a machine with limited memory anyway. Perhaps we should try with 1GB instead of 2GB on a machine with 8GB memory and see how that goes. I assume we would advise having at least 8GB memory for Jellyfish.
Heap size on node 12 defaults to something bigger than 1.4G on machines with more that 2.8G of ram (although I don't know exactly how much)
IMHO setting --max-old-space-size=2048 is fine when building ui, while it rings a bell when needed at runtime (server side)
Long story
I spent some time doing some research.
According to this announcement and this github pr, since node 12, the way heap is sized has slightly changed, mostly in favour of smaller machines
Versioin of V8 included in node setsmax_old_generation_size to 1.4G on x64 cpus. The user provided value of max_old_space_size is used to override this default.
Since node 12, node changes this defaults, favouring smaller machines (good for balena users), but ending up with slightly bigger heaps on bigger machines
So, we are already using a heap 1.4G big by default: raising it to 2G when building the UI should not be a problem
Interesting side note: it seems V8 limits the old generation size to a max of 2G
ljewalsh
changed the title
Add information about setting NODE_OPTIONS when webpack throws memory error
Set max-old-space in run command of ui
Feb 13, 2020
ljewalsh
changed the title
Set max-old-space in run command of ui
Set max-old-space-size in run command of ui
Feb 13, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
5 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heap size on node 12 defaults to 1.4G. This is causing issues with our webpack build. Setting max-old-space-size to 2Gb solves the issue. Since we are already using 1.4Gb, raising to 2Gb shouldnt be an issue