* Help closing a small memory "leak"
@ 2003-02-08 1:42 Jesper Harder
2003-02-08 20:45 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Jesper Harder @ 2003-02-08 1:42 UTC (permalink / raw)
When a new buffer is created with `gnus-get-buffer-create' it's added to
the list `gnus-buffers' to make sure we get rid of it when we quit Gnus.
This is fine, but in some cases the buffers are killed before we quit
Gnus. This means that `gnus-buffers' just keeps growing. It contained
hundreds of #<killed buffer>'s when I noticed.
I've fixed the places that I have come across, but there's probably
still some cases in parts of the code I don't use.
To help find any remaining cases you can install the following hook; use
Gnus for a while, and then look if there's any output in the
*kill trace* buffer.
(defun my-kill-buffer ()
(when (and (boundp 'gnus-buffers)
(member (current-buffer) gnus-buffers))
(let ((standard-output (get-buffer-create "*kill trace*")))
(backtrace))))
(add-hook 'kill-buffer-hook 'my-kill-buffer)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help closing a small memory "leak"
2003-02-08 1:42 Help closing a small memory "leak" Jesper Harder
@ 2003-02-08 20:45 ` Lars Magne Ingebrigtsen
2003-02-08 21:00 ` Jesper Harder
0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-02-08 20:45 UTC (permalink / raw)
Jesper Harder <harder@myrealbox.com> writes:
> I've fixed the places that I have come across, but there's probably
> still some cases in parts of the code I don't use.
How did you fix this?
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help closing a small memory "leak"
2003-02-08 20:45 ` Lars Magne Ingebrigtsen
@ 2003-02-08 21:00 ` Jesper Harder
0 siblings, 0 replies; 3+ messages in thread
From: Jesper Harder @ 2003-02-08 21:00 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Jesper Harder <harder@myrealbox.com> writes:
>
>> I've fixed the places that I have come across, but there's probably
>> still some cases in parts of the code I don't use.
>
> How did you fix this?
I added some code to `gnus-kill-buffer' to remove a buffer from
`gnus-buffers' before it's killed:
(defmacro gnus-kill-buffer (buffer)
`(let ((buf ,buffer))
(when (gnus-buffer-exists-p buf)
(when (boundp 'gnus-buffers)
(setq gnus-buffers (delete (get-buffer buf) gnus-buffers)))
(kill-buffer buf))))
That took care of many cases. For the rest I replaced `kill-buffer'
with `gnus-kill-buffer'.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-02-08 21:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-08 1:42 Help closing a small memory "leak" Jesper Harder
2003-02-08 20:45 ` Lars Magne Ingebrigtsen
2003-02-08 21:00 ` Jesper Harder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).