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.devel Subject: Re: Memory usage report Date: Sat, 19 Sep 2020 17:53:21 +0300 Message-ID: <83d02h3jj2.fsf@gnu.org> References: <87lfh8kyot.fsf@gnus.org> <83k0ws5hzt.fsf@gnu.org> <87h7rwkxtk.fsf@gnus.org> <83imcb61p7.fsf@gnu.org> <871rizl5mf.fsf@gnus.org> <83r1qz48h3.fsf@gnu.org> <871rizjogr.fsf@gnus.org> <83pn6j45rr.fsf@gnu.org> <87wo0ri6kz.fsf@gnus.org> <83o8m34433.fsf@gnu.org> <87imcb43e3.fsf@localhost> <83k0wr4222.fsf@gnu.org> <87ft7f40p8.fsf@localhost> <83h7rv3xsc.fsf@gnu.org> <87wo0rdpud.fsf@localhost> <838sd6522b.fsf@gnu.org> <87tuvuehhq.fsf@localhost> <83wo0q2ohm.fsf@gnu.org> <87mu1lesy3.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11675"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 19 16:54:27 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kJeFv-0002u0-4V for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 16:54:27 +0200 Original-Received: from localhost ([::1]:33452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJeFu-0001jQ-6w for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 10:54:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJeEw-00017P-68 for emacs-devel@gnu.org; Sat, 19 Sep 2020 10:53:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45814) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJeEv-000642-Sk; Sat, 19 Sep 2020 10:53:25 -0400 Original-Received: from [176.228.60.248] (port=3471 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kJeEv-00028C-8d; Sat, 19 Sep 2020 10:53:25 -0400 In-Reply-To: <87mu1lesy3.fsf@localhost> (message from Ihor Radchenko on Sat, 19 Sep 2020 22:34:28 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256178 Archived-At: > From: Ihor Radchenko > Cc: larsi@gnus.org, emacs-devel@gnu.org > Date: Sat, 19 Sep 2020 22:34:28 +0800 > > >> top shows more than 200Mb memory increase. > > > > Which are explained by the statistics produced by GC. IOW, you have > > many more live Lisp objects, which take up those megabytes. > > I meant that 200Mb is Lisp objects, but top shows more then 200Mb > (around 300Mb). So, there is extra 100Mb coming from somewhere else. I got a different (smaller) value, but it isn't worth to continue this argument. > > Since that's related to Org buffers, the best place to discuss this is > > on Org mailing lists. Perhaps there are ways to make Org use less > > memory, but the expertise for that is there. > > The problem is how to identify where the memory usage is coming from. > Indeed, org is using overlays and text properties extensively. But how > much do those influence the memory usage? I think the more useful question is: are all those overlays and text properties necessary? If they are, they take the memory they are supposed to take. > > The "memory" profiler doesn't measure the usage of memory, it measures > > CPU usage triggered by memory allocation calls (instead of the > > periodic profiling signal). So this profile is not supposed to be > > useful for profiling memory usage. > > Thanks! I did not know that. Would it be possible to have a "real" > memory profiler showing how much the memory usage changed after-before > running separate functions? If you mean memory used by Lisp objects, then GC reports that. If you mean memory used by non-Lisp objects, I don't see how we could produce that without having infrastructure for tracking memory allocation, something that debugging malloc libraries already do.