unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Csepp <raingloom@riseup.net>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: Julien Lepiller <julien@lepiller.eu>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	dannym@scratchpost.org, 39813@debbugs.gnu.org,
	39813-done@debbugs.gnu.org, Csepp <raingloom@riseup.net>
Subject: bug#39813: Running Guix in a Virtual Machine - says 1 GB RAM is enough, but it isn't for guix pull
Date: Thu, 14 Jul 2022 14:50:34 +0200	[thread overview]
Message-ID: <8735f3c0ns.fsf@riseup.net> (raw)
In-Reply-To: <9eb8491e8353fb2ddfeb9d508a058fca15b19d40.camel@gmail.com>


Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Am Mittwoch, dem 13.07.2022 um 19:21 +0200 schrieb Julien Lepiller:
>> I've heard that theory before. From observation on my late armhf
>> server
>> (two cores):
>> 
>> - it takes just below 2GB to build one of the derivations
>> - It doesn't swap a single byte
>> - whether with two or a single core, it takes roughly the same amount
>> of memory
>> - substitution is nice, it doesn't require lots of memory (and then -
>> -
>> cores is useless)
>> 
>> I think it's because we load all the files in a batch before we build
>> them. The biggest amount of memory required is not for running the
>> compiler on a thread, but for loading files and keeping them in
>> memory for the whole duration of the build. With more threads, we
>> still don't load each file more than once (twice to build it), so
>> there's no reason it should take more memory.
>> 
>> Or maybe the process of loading and building is inherently single-
>> threaded? I don't think so, but maybe?
> Loading and building is implemented in build-aux/compile-all.scm, which
> does use multiple parallel workers.  However, since all compilation
> appears to be done in the same Guile process, I don't think multi-
> threading makes too big of an impact (it'll be the same garbage
> collector regardless of ordering).
>
> Cheers

Hmm, for some reason it finishes much faster on my i686 netbook with
--cores=1. I'll try to look into it further. I enable swap on it but it
doesn't use a lot of it. Maybe using an HDD matters too, since swapping
is much more expensive on it. Disabling parallelism tends to help because
it can halve the worst case memory usage. If foo.c and bar.c both
require at most 1M during build, building them in parallel is 2M in the
worst case, but only 1M when serialized. Oh and this is with
channel-with-substitutes-available. So either that's broken or something
still needs building.
Anyways, I should take a looksie at build-aux/compile-all.scm, maybe I
can decrease the memory usage.




      reply	other threads:[~2022-07-14 12:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 20:06 bug#39813: Running Guix in a Virtual Machine - says 1 GB RAM is enough, but it isn't for guix pull Danny Milosavljevic
2022-07-13 14:00 ` Maxim Cournoyer
2022-07-13 16:58   ` Csepp
2022-07-13 17:21     ` Julien Lepiller
2022-07-13 20:00       ` Liliana Marie Prikler
2022-07-14 12:50         ` Csepp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735f3c0ns.fsf@riseup.net \
    --to=raingloom@riseup.net \
    --cc=39813-done@debbugs.gnu.org \
    --cc=39813@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    --cc=julien@lepiller.eu \
    --cc=liliana.prikler@gmail.com \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).