From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id IH3oGuP9BWZ3KwAAe85BDQ:P1 (envelope-from ) for ; Fri, 29 Mar 2024 00:31:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id IH3oGuP9BWZ3KwAAe85BDQ (envelope-from ) for ; Fri, 29 Mar 2024 00:31:47 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=inXcWg5a; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711668707; a=rsa-sha256; cv=none; b=Eb5Bz2UElmvg/QsfTwT+nHerBO3yM0cpOYw0H45eL4aTXocs/xdV1YWzwWsQZJeesf7g/M FxmrB1gRMlB88LpQP5dlLhIYQDWvoeKp7dus8eHDDP4eWZ1n9VfAwytwOg5RqxWopvXdLD uNwQ7DNINf4clGZqNIMYs8dMYuZV5ZTgVlkdabMjOcO+k/0NaU7+6CFKRntBctOEegBi94 8wdjk4YqC9oE9cplcIUx1zPduBBHCYZULY5jpXJMgvdPAb8jPCDG8HusoBv0h8+FUXll+1 Et9BSosLVQGF5X5FT95aDZadOO5DHUWZ7Uh7W3tnWO8r7kKrEir4ZZ+5wZziCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=inXcWg5a; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711668707; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=PYQbxDpWeHXKVyvleKAEPg4tLLwK+r47B/nvaiJb+Dw=; b=VcnlapmL+ZH8xjmbHJbVW98qYOHAU7uvSc7BJeb5Lhlpbz8IhoPP3TBTh4igUGEIkstRcc Hy1dWjAZM/raYfmi/0VC1xJLzLSvyIJKOoJHtmfLKE5YBMpgMr7BwWJcc20RikRm8gE0UC IfHdGjc5hlfGUr9z2oKdCdhqRsdhYFVGteysy6uJLo7MgRYvY0R21rM+Zicjw4NmpPSLCK MwBbNOLmO8T29GPDNw+FeAG7aPoPEPMajbdQPKUhdL1ukY59/MxJ//3+dnn/PWsSED6hDg P5T6fb525dIC4VrS3BLoeyuoOPA/NbCu2pUmUYsP6uln10g/h/RqRUyrgOi5Gg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3342A16AA5 for ; Fri, 29 Mar 2024 00:31:46 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpzD6-0005nf-Q2; Thu, 28 Mar 2024 19:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpzD4-0005nV-Pv for guix-devel@gnu.org; Thu, 28 Mar 2024 19:31:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpzD2-0008L2-K2; Thu, 28 Mar 2024 19:31:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=PYQbxDpWeHXKVyvleKAEPg4tLLwK+r47B/nvaiJb+Dw=; b=inXcWg5aA6LR/1dm7E+4 N+PFWkbX3FoNYrxavwkgXAUpA+TlwDoH2HLRK9+tIbt8Pb9bJS2EW1O1w1zAjZ4P3o3xinHolCo5T OZuqQxv151ZST79hM+pRgsqbU7alO76ZQdnRl8CCINLxfBBBuzpeVulKFk7magz+Jl0j7txmJTkKT hXsB9hr4eR+G3gBaj6Ni+kZmvtEvYqQMOX/eANsklEtLkAD6mcQxkqqrw6wZQ5Lo53ET7uFAowmKf kAfhMPfHtJUZHm4L6CUZK5yBgr51YHDV1yhtvEMV8stBC1eBLeqxaFcOCpzO9NZncjRXIH4UG3cHq EazfJfShNNXrNA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Edouard Klein Cc: guix-devel Subject: Re: guix --container is RAM hungry In-Reply-To: <87v85fp8bj.fsf@rdklein.fr> (Edouard Klein's message of "Thu, 21 Mar 2024 22:44:41 +0100") References: <87v85fp8bj.fsf@rdklein.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 9 Germinal an 232 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour de l'Aulne X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 29 Mar 2024 00:30:57 +0100 Message-ID: <871q7uj5n2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -11.06 X-Migadu-Queue-Id: 3342A16AA5 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -11.06 X-TUID: 6kV5O11j7dkV Hi Edouard, Edouard Klein skribis: > I'm a huge fan of guix --container, and I created a system to use those > by default for network services. But the VPS these services run on has > only 2GB of RAM, and I just realized that a container, by default, > requires at least 200MB. Ouch, confirmed: --8<---------------cut here---------------start------------->8--- $ \time -v guix shell -C coreutils -- uname 2>&1 |grep 'Maximum resident' Maximum resident set size (kbytes): 283048 $ \time -v guix shell coreutils -- uname 2>&1 |grep 'Maximum resident' Maximum resident set size (kbytes): 56588 $ guix describe Generation 297 Mar 24 2024 23:12:25 (current) guix 28bc0e8 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 28bc0e870b4d48b8e3e773382bb0e999df2e3611 --8<---------------cut here---------------end--------------->8--- As raingloom and Ricardo wrote, there=E2=80=99s a Guile process that keeps waiting. The =E2=80=98-C=E2=80=99 variant has to load more modules and do more work = (compute derivations), so it=E2=80=99s not surprising that it takes more memory than= the other variant (on a cache hit it has nothing to do). Merely loading (guix scripts shell) consumes a lot, but GC says it=E2=80=99s =E2=80=9Conly=E2=80=9D using 7=C2=A0MiB out of this: --8<---------------cut here---------------start------------->8--- $ \time -f %M guile -c '(use-modules (guix scripts shell)) (pk (quotient (= assoc-ref (gc-stats) (quote heap-size)) 1024))' ;;; (7204) 38272 --8<---------------cut here---------------end--------------->8--- So what we=E2=80=99re seeing here is probably the mappings made by the load= er (libguile/loader.c). Needs more investigation=E2=80=A6 Ludo=E2=80=99.