I don't think there's a built-in way to take RAM into account. ninja and
autoninja both look at the number of CPU cores/threads.

FWIW, with 2 GiB memory per thread (so e.g. 16 GiB on a 4C/8T CPU), I
haven't had OOM issues on a fairly wide range of machines from laptops to
workstations.

is_component_build = true may help with linker memory requirements (as well
as disk space consumption when building multiple targets).

On Tue, Apr 30, 2024 at 9:01 AM Ben Noordhuis <[email protected]> wrote:

> On Tue, Apr 30, 2024 at 3:56 AM Paul Harris <[email protected]> wrote:
> >
> > Hi,
> >
> > I'd like to run Ninja build with as many jobs as I have CPUs.
> > However, some of the build jobs require a lot of RAM (especially for
> Debug builds), so I have to reduce the number of jobs artificially, just to
> keep the number of jobs under the ram limit.
> >
> > Is there a clever set of flags or options in the v8 build system that
> would automatically manage the number of jobs launched based on max RAM?
> >
> > Or do people simply learn from the past and set a max job limit for that
> particular machine?
> >
> > Thanks,
> > Paul
>
> It's been my experience that it's really only the link commands that
> consume lots of memory, not compilation, so I changed the $ld ninja
> variable from `c++` to `flock c++`, to stop them from running in
> parallel.
>
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAKSzg3TLKar9UvpMSMGToXjpsvUY_og6tiiFBfyE0J6dVG9%3D8Q%40mail.gmail.com.

Reply via email to