From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Frode Vatvedt Fjeld Newsgroups: gmane.emacs.help Subject: Re: How to debug elisp memory leak Date: Sat, 02 Oct 2004 12:33:33 +0200 Organization: University of Tromsų Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <2hbrfls936.fsf@vserver.cs.uit.no> References: <2hzn3qz30q.fsf@vserver.cs.uit.no> <2hllf5xh6z.fsf@vserver.cs.uit.no> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1096713529 10865 80.91.229.6 (2 Oct 2004 10:38:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 2 Oct 2004 10:38:49 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 02 12:38:33 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CDhHc-0006NW-00 for ; Sat, 02 Oct 2004 12:38:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDhO6-0001iv-1E for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Oct 2004 06:45:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!news.uit.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 96 Original-NNTP-Posting-Host: vserver.cs.uit.no Original-X-Trace: news.uit.no 1096713214 68866 129.242.16.151 (2 Oct 2004 10:33:34 GMT) Original-X-Complaints-To: usenet@uit.no Original-NNTP-Posting-Date: Sat, 2 Oct 2004 10:33:34 +0000 (UTC) User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (berkeley-unix) Cancel-Lock: sha1:+eolLjMQiuzeYq4QxCThvKlBAIw= Original-Xref: shelby.stanford.edu gnu.emacs.help:125642 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20999 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20999 > Stefan Monnier writes: >> I don't think there's a quick answer to this. But for a start, can >> you try the pckage below? Frode Vatvedt Fjeld writes: > I will, thank you. So, now the problem occurred, and I've got memory-usage loaded. The output from a relatively fresh emacs (with most of my normal work-set loaded) looked like this: -------snip------- Garbage collection stats: ((614832 . 32572) (42162 . 117) (2012 . 4693) 2899677 753431 (225 . 175) (76662 . 771) (77466 . 5064)) => 5179232 bytes in cons cells 1014696 bytes in symbols 134100 bytes in markers 2899677 bytes of string chars 3013724 bytes of vector slots 4800 bytes in floats 2168124 bytes in intervals Total bytes in lisp objects (not counting string and vector headers): 12154060 Buffer ralloc memory usage: 79 buffers 5012158 bytes total (3527923 in gaps) Size Gap Name 253765 2000 compiler.lisp 119948 2000 TAGS [...] -------snip------- Now, in emacs after I got the first "lisp pointer size exceeded" warning, it looks like this: -------snip------- Garbage collection stats: ((803738 . 124208) (50225 . 55) (5454 . 5139) 2517494 981855 (238 . 343) (85714 . 2690) (98613 . 4896)) => 7423568 bytes in cons cells 1206720 bytes in symbols 211860 bytes in markers 2517494 bytes of string chars 3927420 bytes of vector slots 6972 bytes in floats 2475312 bytes in intervals Total bytes in lisp objects (not counting string and vector headers): 14823781 Buffer ralloc memory usage: 126 buffers 10093087 bytes total (6913072 in gaps) Size Gap Name 1272492 194988 *Gnus Backlog* 253765 2000 compiler.lisp 119948 2000 TAGS [...] -------snip------- It seems to me that the "total bytes in lisp objects" has developed quite reasonably, and the problem seems to be in the "ralloc" stuff. In particular the *Gnus Backlog" thing. I ran "M-x gnus-backlog-shutdown" which removed *Gnus Backlog*, and the ralloc part of memory-usage became -------snip------- [...] Total bytes in lisp objects (not counting string and vector headers): 14773166 Buffer ralloc memory usage: 124 buffers 8616381 bytes total (6721395 in gaps) [...] -------snip------- Other than this, I can see that there are a number of buffers that are heavily (re-)used by Gnus that are small in size, but with huge gaps. For example, there's a buffer " *nntpd*" whose size is zero, but whose gap is 1961195. Can I conclude that the problem has to do with these gaps? Is there an easy way to tell emacs to re-compute gap-buffers or somesuch? Thanks, -- Frode Vatvedt Fjeld