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 }}
Repository navigation
Allocation and worker limit options for Turbopack
#95249
Give control to the users over turbopack-born allocations & the number of workers that can be spawned, at the cost of performance
Allow low-end machines to run turbopack instead of crashing
Non-Goals
Replace any sort of heuristics in place currently within turbopack
Background
Turbopack will grow its memory usage regardless of Node memory settings and regardless of system limitations.
That isn't a problem on a development machine or on a build server, but it is an issue on a VPS, particularly a small one.
Turbopack grows its allocations fast, so even using swap memory or zram does not save a system from OOM issues, having Linux kill processes to clear space while the swap is still barely used. Eventually, the build also fails for the same reason.
This seems to happen even with a small to medium projects.
Proposal
Adding build options for turbopack to:
Limit total allocation at a given moment (with an acceptable margin of error)
Limit the total number of workers that may be used at maximum
While this could potentially massively slow down builds when these options are enabled, it would also prevent the build from straight-up failing on low-end machines while taking down most running processes with it.
That allocationStrategy claim is sus... I think this answer was just straight through AI generated, no review from the author. There's also a couple of other flags, but we should wait for a Turbopack official announcement.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Goals
Non-Goals
Background
Turbopack will grow its memory usage regardless of Node memory settings and regardless of system limitations.
That isn't a problem on a development machine or on a build server, but it is an issue on a VPS, particularly a small one.
Turbopack grows its allocations fast, so even using swap memory or zram does not save a system from OOM issues, having Linux kill processes to clear space while the swap is still barely used. Eventually, the build also fails for the same reason.
This seems to happen even with a small to medium projects.
Proposal
Adding build options for turbopack to:
While this could potentially massively slow down builds when these options are enabled, it would also prevent the build from straight-up failing on low-end machines while taking down most running processes with it.
All reactions