Compiler flags and memory usage

John Reiser jreiser at
Mon Jun 16 01:54:44 UTC 2014

> coin-or-lemon is still in f20 updates-testing repos

Please mention such facts early and prominently.  It saves time
for those who try to help you.

> So my RAM is not adequate.

It *can* work, but your machine is not configured properly for large compiles:
> $ cat /proc/swaps
> Filename				Type		Size	Used	Priority
> $     ### /proc/swaps is empty.  There is no swap space.
Get some swap space, either a disk partition, or a file of at least 6GB:
    dd if=/dev/zero of=my_swap_space bs=32k count=200k
    mkswap my_swap_space
    swapon my_swap_space

I succeeded with /usr/bin/top showing "KiB Mem: 3914304 total" [3.914GB RAM].
[I used less than actual RAM by specifying " mem=NNNNm " on the kernel boot
command line.]  I had 6GB of swap space and specified "make -j1" in the .spec.
Building took 56 minutes after I booted with kernel command line parameter
" cgroup_disable=memory ", turned off graphical desktop via "telinit 3"
from a terminal as root user [so that X11 and the window manager did not
compete for space with the compiles], and logged in as a normal user on a text console.
Disabling the memory cgroup saved about 15MB RAM (about 0.4% of total RAM).
This may seem small, but every page counts.

With 7.342GB of RAM and 4 processors ("rpmbuild -bc" using the default
"make %{?_smp_mflags}" in .spec) it took 30 minutes and 2.8GB of swap space.
With 7.342GB of RAM and 1 processor ("make -j1" in .spec) it took 25 minutes
and no swap space.  So I would say that this package needs 10GB total RAM+swap
to build when using the existing .spec.

More information about the devel mailing list