help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug elisp memory leak


From: Frode Vatvedt Fjeld
Subject: Re: How to debug elisp memory leak
Date: Sat, 02 Oct 2004 12:33:33 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (berkeley-unix)

> Stefan Monnier <monnier@iro.umontreal.ca> 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 <frodef@cs.uit.no> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]