From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Memory usage report Date: Sat, 19 Sep 2020 00:14:34 +0800 Message-ID: <87wo0rdpud.fsf@localhost> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20719"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 18 18:32:45 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 1kJJJU-00057U-V9 for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Sep 2020 18:32:45 +0200 Original-Received: from localhost ([::1]:45382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJJJT-0007ZL-Vt for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Sep 2020 12:32:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJJ31-0000vR-S1 for emacs-devel@gnu.org; Fri, 18 Sep 2020 12:15:43 -0400 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:39233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJJ2x-0004ut-K7; Fri, 18 Sep 2020 12:15:43 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id v14so3266931pjd.4; Fri, 18 Sep 2020 09:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=KEcWNOPjjm1fPg6CeL5sx15JefF7LtjWxuHfrpbAZ4I=; b=ZVMr0s1Bo5wZ2P6t3jpyfeXql1bYmcQLWNulcyuvAH9OvFbWvdaL2jYTxWxiOSRPZt paTcXXQdJZZyFOPWDU7Ka80FKr0SYma/NMKFUsg4TAnq0g60FPtZ93kix1sZ5tYdtLw5 2UMvW/VjAXUKTe41f9aLLAUpTimekqumtRuNacJkGaYAw0+r6Av9eWLty+YT5ziLkse0 YA02TGo/uDKX7wCEfsKvCCnlRFGTYIOgN0z0U7ilCiDyMuOiooy1shwiC67WvqGFKQpY LTcj3PG7JfDx17nRtP0MHTqkv441prSc5YIvz5mQRvfMTf/efM0l15FZR4ctQfSvE7Tm IGCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=KEcWNOPjjm1fPg6CeL5sx15JefF7LtjWxuHfrpbAZ4I=; b=Ik0IY/iaRraqozJieL26IDbYoonusMfZYL6R21GFKIIFPgW4O9Tvl5p4sGqz+gg6dV AThXra/C6gh//RSDdAWw2oXLLHIfkpjiUoN3bcSL6gR7OEXz+VWoan8CZEXPBOnB00Xn K7n5AfCmN84BhODCkn9WU9OFr/Ta6IA7A4G+8yq+/3mbvMn57i31Pj/zHBPMbCWTqmTV lDvIvmHKFNnLJJyRUhKwvEVhAtibIYjD/Us0kOT4LUb8FmJO4ZMU4Y7HnlqgEkZYgC24 JI+1MZkOb9RW3FYVXbearBiFvQCzHXI3fd9Gm26tz8GxVd9fw/yWfTF66bHH8hYF4zT+ 6f9g== X-Gm-Message-State: AOAM531s8oWS1NrEX1GcvwuPSGsoBvwwqp2XI9DONlWuk+nmUP0aXmMB IXsH7lyT9d7y6o150nf/2YpgaV5VnwwgcuOP X-Google-Smtp-Source: ABdhPJyUMgEpK0rI/IY3ijAc7KlRa8mmFiinpmz5it3Wd22z+ZUt1H1WSY2v0wiR29Sp9zlgNcCHKg== X-Received: by 2002:a17:90a:d246:: with SMTP id o6mr14270067pjw.211.1600445736444; Fri, 18 Sep 2020 09:15:36 -0700 (PDT) Original-Received: from localhost ([104.250.131.79]) by smtp.gmail.com with ESMTPSA id y1sm3464635pgr.3.2020.09.18.09.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 09:15:35 -0700 (PDT) In-Reply-To: <83h7rv3xsc.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:256115 Archived-At: > Did you actually see cases where something like that happens? I mean > that loading some library, or all of your Org files, causes increase > in memory usage of hundreds of MBs (320MB in your example)? I only > see this when the buffers themselves are near that value. Yep. I see it every time I run Emacs. I have done M-x memory-usage before and after loading org-agenda (which loads all my working org files). Before: Total in lisp objects: 77.4MB (live 47.7MB, dead 29.7MB) Buffer ralloc memory usage: 16 buffers 39.3kB total (23.6kB in gaps) After: Total in lisp objects: 283MB (live 218MB, dead 64.7MB) Buffer ralloc memory usage: 47 buffers 6.79MB total (78.6kB in gaps) This is not all the memory increase. Some part seems to be in heap. Also, the memory usage is even worse when org-mode is using overlays (I am on org-mode branch using text properties instead of overlays in org). Full memory-usage reports are shown below. The memory consumption gets even worse after I use Emacs for several hours. Recently, it tend to settle around 20% (of 8Gb) with lisp objects taking around 1Gb. This last part is the most annoying and also difficult to track - I have no easy way to know if it is also caused by org-mode or it is something else. Best, Ihor Before: Garbage collection stats: ((conses 16 934007 1096370) (symbols 48 73755 2041) (strings 32 265462 1168= 61) (string-bytes 1 9693220) (vectors 16 115429) (vector-slots 8 1423224 12= 15629) (floats 8 1419 3034) (intervals 56 1366 249) (buffers 992 16)) =3D> 14.3MB (+ 16.7MB dead) in conses 3.38MB (+ 95.7kB dead) in symbols 8.10MB (+ 3.57MB dead) in strings 9.24MB in string-bytes 1.76MB in vectors 10.9MB (+ 9.27MB dead) in vector-slots 11.1kB (+ 23.7kB dead) in floats 74.7kB (+ 13.6kB dead) in intervals 15.5kB in buffers Total in lisp objects: 77.4MB (live 47.7MB, dead 29.7MB) Buffer ralloc memory usage: 16 buffers 39.3kB total (23.6kB in gaps) Size Gap Name 13213 2000 *scratch* 1252 769 *Messages* 676 1574 *Buffer Details* 294 1940 *straight-watcher* 265 1756 *straight-process* 124 1911 *code-conversion-work* 112 3941 *helm M-x* 82 2000 *elfeed-log* 67 2000 *pdf-info-query--parse-response* 53 2000 *Echo Area 1* 24 2001 *Echo Area 0* 8 12 *pdf-info-query--escape* 0 20 *Minibuf-1* 0 20 *Minibuf-0* 0 20 *epdfinfo* 0 2067 tq-temp-epdfinfo After: Garbage collection stats: ((conses 16 9393579 2919763) (symbols 48 75965 293) (strings 32 323708 2245= 89) (string-bytes 1 13017637) (vectors 16 154787) (vector-slots 8 2249055 1= 365412) (floats 8 1630 2854) (intervals 56 547977 53455) (buffers 992 47)) =3D> 143MB (+ 44.6MB dead) in conses 3.48MB (+ 13.7kB dead) in symbols 9.88MB (+ 6.85MB dead) in strings 12.4MB in string-bytes 2.36MB in vectors 17.2MB (+ 10.4MB dead) in vector-slots 12.7kB (+ 22.3kB dead) in floats 29.3MB (+ 2.85MB dead) in intervals 45.5kB in buffers Total in lisp objects: 283MB (live 218MB, dead 64.7MB) Buffer ralloc memory usage: 47 buffers 6.79MB total (78.6kB in gaps) Size Gap Name 2345866 2000 nodeadline.org 1914956 2000 notes.org 695164 2000 TODO.org 548214 2000 config.org 487501 2000 get_started_org_mode.org 361666 2000 CuNb-beamcrack.org 340586 2000 References.org 84150 2000 articles.org 47507 2000 Journal.org 45875 2000 =D0=9E=D0=BB=D0=B4=D0=B8 =D0=93=D0=B5=D0=BD=D1=80=D0=B8 =D0= =9B=D0=B0=D0=B9=D0=BE=D0=BD.org 31561 2000 mirror-text.org 30235 2000 rss.org 29662 2000 org-autosort.org 18633 2000 [book]DFR.org 14412 801 *scratch* 9932 2000 schedule.org 8719 2000 Abraham Daniel.org 7292 2000 org-mode.org 6172 2000 inbox.org 4503 2000 contacts.org 2564 2000 *code-conversion-work* 1944 2000 gnuplot.org 1838 183 *Messages* 1125 950 *Memory-Profiler-Report 2020-09-18 23:59:40* 897 1131 *emacsql-log* 889 1727 *Agenda Commands* 681 1569 *Buffer Details* 301 1720 *Org Agenda(d:)* 294 1940 *straight-watcher* 265 1756 *straight-process* 125 3928 *helm M-x* 119 2000 frommobile.org 82 2000 *elfeed-log* 67 2000 *pdf-info-query--parse-response* 50 1973 *Helm Completions* 41 1988 *helm-mode-profiler-report-write-profile* 35 1990 *Echo Area 0* 31 1991 *helm-mode-profiler-start* 13 2474 *emacsql-sqlite* 8 12 *pdf-info-query--escape* 6 14 *temp* 0 2030 *Minibuf-1* 0 20 *Minibuf-0* 0 2053 *Echo Area 1* 0 20 *epdfinfo* 0 2067 tq-temp-epdfinfo 0 20 *server* Eli Zaretskii writes: >> From: Ihor Radchenko >> Cc: larsi@gnus.org, emacs-devel@gnu.org >> Date: Fri, 18 Sep 2020 22:30:11 +0800 >>=20 >> Seeing how much memory is used by buffer-local variables in org >> buffers would help. Similarly, total memory consumption in variables >> from individual packages would be helpful to pinpoint why the memory >> usage is high. > > That'd require some filtering of the variables, not just finding the > largest one. > > Did you actually see cases where something like that happens? I mean > that loading some library, or all of your Org files, causes increase > in memory usage of hundreds of MBs (320MB in your example)? I only > see this when the buffers themselves are near that value.