Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102485

Restrict max number of parallel linker (or moc) jobs

XMLWordPrintable

       There are several reasons to restrict number of max linker jobs running in parallel:

      • Avoid losing the machine because of the high RAM requirements of each process
      • Work more efficiently, since linking is an I/O bound process, it makes sense to keep the rest of the cores busy with CPU-bound tasks like compiling
      • Take advantage of modern linkers like mold; these are designed to be highly parallel, so one process is capable of utilizing all cores and saturating I/O; more processes would only hinder the process.

      LLVM as a CMake project implements such a knob (LLVM_PARALLEL_LINK_JOBS).

      Qt would also benefit from restricting the number of parallel moc jobs. I am using a distributed compiler (icecream) and am used to running ninja -j 128 or similar, and currently moc is the primary reason my machine dies during compilation (hundreds of instances of moc are spawned locally and the OOM killer goes on a rampage).

      I wish I could set MAX_PARALLEL_MOC_JOBS=$NCPU.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            orkun.tokdemir Orkun Tokdemir
            jimis Dimitrios Apostolou
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes