skip to Main Content

I’m trying to build chromium on my laptop (i7-1260P, 16Gb RAM) under Ubuntu.
What I do:

gn gen out/Default
autoninja -C out/Default chrome

At some point build process hangs and I see a significant raise of memory consumption in the System monitor (it rases from the 5Gb to 16Gb in 10-15 seconds). Also I see almost an 100% load of every of my processors. After it build process crashes with error:

[31140/52638] CXX obj/content/browser/browser/browser_plugin_guest.o
FAILED: obj/content/browser/browser/browser_plugin_guest.o 
ccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/content/browser/browser/browser_plugin_guest.o.d -DDCHECK_ALWAYS_ON=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -
<<<<<<<<<<<<A LOT OF ROWS WITH BUILD VARIABLES, LINKING ETC>>>>>>>>>>>>>
_plugin_guest.cc -o obj/content/browser/browser/browser_plugin_guest.o
[31151/52638] CXX obj/content/browser/browser/browser_interface_binders.o
ninja: build stopped: subcommand failed.

The build process creates many clang++ processes (about 12), each of which consumes about 200 MB of memory (before the memory consumption starts to grow uncontrollably).
I tried to find some build argument which could reduce number of parallel processes but couldn’t.

2

Answers


  1. Chosen as BEST ANSWER

    So, I solved it via ninja flag v which set number of parallel processes. For example I reduced processes amount to 8 (from 16) and it works:

    autoninja -C out/Default chrome -j8
    

  2. i7-1260P, 16Gb RAM – this is too weak hardware for linking the whole Chromium. You should use the component build. Add the following line into your args.gn

    is_component_build = true
    

    The other useful tunings: Linker Crashes.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search