From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#45705: [feature/native-comp] Excessive memory consumption on windows 10 Date: Sat, 09 Jan 2021 13:55:08 +0200 Message-ID: <83y2h2gw9v.fsf@gnu.org> References: <87y2h5hjve.fsf@gmail.com> <831revjyja.fsf@gnu.org> <83turrif53.fsf@gnu.org> <83lfd2ilwf.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30473"; mail-complaints-to="usenet@ciao.gmane.io" Cc: edouard.debry@gmail.com, 45705@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 09 12:56:32 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kyCrA-0007oZ-I2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 12:56:32 +0100 Original-Received: from localhost ([::1]:39774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyCr9-0002W8-3B for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 06:56:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyCqg-0002Up-Kg for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 06:56:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyCqg-0000p2-D8 for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 06:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyCqg-0000zG-BK for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 06:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jan 2021 11:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45705 X-GNU-PR-Package: emacs Original-Received: via spool by 45705-submit@debbugs.gnu.org id=B45705.16101933363762 (code B ref 45705); Sat, 09 Jan 2021 11:56:02 +0000 Original-Received: (at 45705) by debbugs.gnu.org; 9 Jan 2021 11:55:36 +0000 Original-Received: from localhost ([127.0.0.1]:51291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyCqG-0000yb-DD for submit@debbugs.gnu.org; Sat, 09 Jan 2021 06:55:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyCqE-0000yO-VT for 45705@debbugs.gnu.org; Sat, 09 Jan 2021 06:55:35 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58564) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyCq8-0000bt-5g; Sat, 09 Jan 2021 06:55:28 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1912 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kyCpk-0008Rr-8a; Sat, 09 Jan 2021 06:55:06 -0500 In-Reply-To: (message from Andrea Corallo on Sat, 09 Jan 2021 10:55:23 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197545 Archived-At: > From: Andrea Corallo > Cc: edouard.debry@gmail.com, 45705@debbugs.gnu.org > Date: Sat, 09 Jan 2021 10:55:23 +0000 > > > What about memory usage when there's a background compilation of Lisp > > going on? GCC is known to be a memory hog in some cases, so I wonder > > what happens in this case with libgccjit. > > In June we changed the way we store immediate objects in the shared and > this makes the compilation way lighter on the GCC side (both in time and > memory). I've no precise data on this other than the experimental > observation that compiling all Elisp files in Emacs on 32bit systems is > not anymore an issue. This IIUC implies that the memory footprint for > each compilation is always < 2GB. You assume that the compilations are all done serially? AFAIK, most people build Emacs with "make -jN", so parallel compilation is an important use case. I guess we will have to collect the information about that, if you say we don't have it now. > As a note: in all cases except bootstrap the final pass (the one driving > libgccjit) is executed as a sub-process, this to protect us from > eventual GCC leaks and not to generate unnecessary fragmentation. In > async compilation we indeed run all the compilation (also the Lisp > computation) in the child process, so compiling should not have impact > on the memory footprint of the main Emacs session. That's fine, but the memory footprint of such a subprocess is also of interest, as it could be relevant to the overall memory pressure of the OS, and thus indirectly on the parent Emacs process as well. > > (Do we allow multiple async compilations, btw? if so, how many > > concurrent compilations can be running, and how do we or the user > > control that?) > > Yes see Thanks. This needs further tuning, IMO, both per the FIXME (i.e. provide a primitive to return the number of execution units), and wrt the default value being half of the available units. We should pay attention to the system's load average as well, I think. > > Also, what are the numbers for a session that has been running for > > several days? I understand that it would be hard for you to collect > > such numbers about all the configurations, but could you show the > > growth of the configuration you are routinely using, which I presume > > is --with-x --with-nativecomp and with your config? As your numbers > > above show, it starts at 1.5 GiB, but what is the footprint after a > > day or a week? > > ATM I can provide this number, this is an Aarch64 daemon compiled with > '--without-x' with an up-time of 25 days and is showing a footprint of > 765M. OK, thanks. > The hard part is to have a reference to compare against as the memory > footprint is strictly connected to the usage. One with very regular > working habits should work like one week on vanilla and one week on > native-comp to make a comparison. I've no regular working habits so I > fear I'm not the best fit for this comparison. I agree, these numbers still need to be collected. Maybe we should ask on emacs-devel that people who use the branch report their numbers?