bugmake - Bugs: bug #52697, More varieties to -j switch


bug #52697: More varieties to -j switch

Submitted by:  None
Submitted on:  Tue 19 Dec 2017 08:46:09 PM UTC  
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  None Operating System:  Any
Fixed Release:  None Triage Status:  None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 18 Aug 2018 08:53:45 PM UTC, comment #3:

I'm pretty sure something like this was already proposed, discussed and/or even implemented somewhere, but anyway:

here is a quick and dirty hack I'm using to successfully compile gcc (together with some other required measures) on my raspberry pi which has four cores but 'only' 1 GB of RAM: an -M [minavail] option, similar to -l [load].

Specifying this option will inhibit launching new jobs until there is at least MINAVAIL megabytes of RAM is available. Works only on Linux by scanning /proc/meminfo for MemAvailable string.

Wed 20 Dec 2017 01:49:23 AM UTC, comment #2:

Maybe I forgot to make clear what the main problem is:
the -j switch takes not care about ram and this is becoming more and more the important limit - especially in object orientated languages there should be something preventing starting more compile processes. Even on my 12GB workstation I ran into memory problems *, while I would like the -j13 to speed up compiling the packages where it works.

Thanks for your patience. I think I should go to sleep before I write more hard to understand stuff. Anyways, I have the idea since a long time and thought about ist also when I was not tired. ;-)

  • With certain packages the whole system gets stuck swapping and I have to stop the whole update (which can be tricky when the system is hardly responding), edit my make.conf, do a "emerge --oneshot" on that package, edit my make.conf back to -j and continue with my "emerge --deep --newuse --update @world"
Wed 20 Dec 2017 01:25:03 AM UTC, comment #1:

I see there is a Typo: The 3rd Sentence should be "Compiling c with make -j8 works ..."

Tue 19 Dec 2017 08:46:09 PM UTC, original submission:

On modern Systems there is an increasing number of CPU cores/threads. For example my phone has a gentoo chroot, 8cores and 3GB RAM (shared with the Android). Compiling c with make -j works fine, python usually too, c++ makes the system crash. Some packages are written in more than one language. Additionally the -j switch is set globally in /etc/portage/make.conf and cannot be switched during an update or rebuild of multiple packages which is a crucial thing in using a Gentoo system.
I wish to have more options deciding the number of compile threads based on the amount of ram used or which programming language gets compiled.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




No changes have been made to this item

Back to the top

Powered by Savane 3.4