Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


On Sun, 29 May 2016 13:17:14 +0100
Wols Lists <antlists@youngman.org.uk> wrote:

On 29/05/16 09:21, YuGiOhJCJ Mailing-List wrote:
On Sun, 29 May 2016 01:35:47 +0100
Wols Lists <antlists@youngman.org.uk> wrote:

On 24/05/16 11:26, Eike Rathke wrote:
Hi YuGiOhJCJ,

On Thursday, 2016-05-19 17:26:21 +0200, YuGiOhJCJ Mailing-List wrote:

Dumb question: how much system memory is available?
I have 4GB of memory:

That certainly is not enough and it will either grind your machine to
heavily swap, or break the build / abort things if no swap is available.

$ free -m
             total       used       free     shared    buffers     cached
Mem:          3995        559       3436          0         53        330
-/+ buffers/cache:        175       3819
Swap:          956          0        956



And why are you building under /tmp/ and how much free disk space is
there?

Well, I could do it in /home but as it is a NFS share, it is slower than in /tmp

Ok, but as Linoel already said, using /var/tmp/ might be a better
choice. Also, if disk space is limited under /tmp/ then building there
may conflict with temporary files the compiler and linker create, which
can become quite large.

Bear in mind, the LFS says that /tmp and /var/tmp behave differently. On
a "correctly" configured system, the contents of /tmp are NOT guaranteed
to survive a system crash. Which is why /tmp is often configured as a
tmpfs. On the other hand, the contents of /var/tmp ARE guaranteed to
survive, which is why vi and emacs and that sort of program all store
their replay logs there ...

and which is why the OP's choice of /tmp was probably correct :-)
although most distros don't seem to make the /tmp directory overly
large. (They also seem not to allocate much swap space.)

Do you think I don't have enough memory?
Is there a way to require less memory while building libreoffice or should I buy more memory?

Buy memory ;-)  at least 8GB are needed, but when building with debug
and symbols even that might result in swapping if you forgot to quit
a previous gdb session before linking Calc for example.. 12GB or having
a larger swap than just 1GB is recommended.

My rule of thumb is simple. Disk space is cheap, I allocate twice
maximum ram per disk. In other words, my desktop is maxed out at 16Gb so
the two disks each have a 32Gb swap partition. My laptop maxes out at
8Gb so there should be a 16Gb swap partition on the drive (actually it's
32Gb :-)

The reason for that is - in the old days everybody said "swap should be
twice memory" which was thought to be an old wives' tale. Then kernel
2.4 came out, and it turned out (1) that this requirement was actually
part of the swap algorithm, and (2) the optimisations and hacks and
whatever that enabled smaller swaps were a heap of old crufty rubbish.
Linus ripped out all the hacks and vanilla 2.4 kernels started crashing
everywhere they had a swapspace of less than twice ram.

Obviously, new optimisations have gone in, presumably much better than
before, but nowhere have I found any reference to whether the
fundamental algorithm has been replaced. So I'm assuming it hasn't, and
allocate at least twice ram to ensure I get top performance.

Which means my fstab contains the following line

tmp     /tmp    tmpfs   size=10G,mode=0777      0 0

and you'll notice the size=10G parameter, giving me a 10Gb /tmp directory.

(I run gentoo, so /var/tmp/portage is also a tmpfs, and that's declared
at 30Gb!)

Cheers,
Wol

In my /etc/fstab file I got this line on Slackware 14.1:
$ grep "tmp" /etc/fstab
tmpfs            /dev/shm         tmpfs       defaults         0   0
It is a bit different than your line in /etc/fstab but I don't know if that matters.

OK, so I see three things I can do in this order:
1) Try to build libre office in an other directory than /tmp (because it is a tmpfs) and /home 
(because it is an NFS share)

With no size option, /tmp will default to half of ram. I would just add
the "size" option, so change the fourth parameter to
"size=10G,defaults", and you'll have a 10gig /tmp.

MAKE SURE that ram+swap is bigger, or a "/tmp is full" will crash your
machine!


It seems that my machine does not crash whereas currently:
 * I got this line in my /etc/fstab file:
tmpfs            /dev/shm         tmpfs       defaults         0   0
 * My RAM is 4GB
 * My swap is 1 GB
 * RAM + swap = 5GB
 * Calling '$ du -h /tmp' gives me a /tmp disk usage of 15GB (which is bigger than my RAM + swap)

Why my machine does not crash in these conditions?

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.