unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* defadvice on garbage-collect doesnt work?
@ 2007-03-13 21:37 joakim
  0 siblings, 0 replies; 5+ messages in thread
From: joakim @ 2007-03-13 21:37 UTC (permalink / raw)
  To: help-gnu-emacs

I would like to make a little memory meter for emacs on the mode line.

I would like to use the information returned by (garbage-collect) but
it doesnt seem right to do a garbage collect everytime the modeline is
displayed, therefore i would like to store the values calculated by
the last gc in a variable:

in ielm:

(defadvice garbage-collect (around
garbage-collect-advice-store-values) (setq last-gc-value ad-do-it))
(ad-activate 'garbage-collect)

(garbage-collect)
last-gc-value

last-gc-value shows the right values, same as returned by
(garbage-collect). However, when I leave emacs running for a couple of
hours, last-gc-value doesnt change. I interpret this as meaning my
defadvice is ignored when emacs gc:s automatically, but not when
called interacvtively.

Any hints how to achieve this? BTW the use-case I had in mind for the
memory meter was to see what kinds of operations gobbles up memory. I
have trouble with emacs growing slowly over a fortnight until its so
huge it crashes. 


-- 
Joakim Verona

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-14 23:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.900.1173821943.7795.help-gnu-emacs@gnu.org>
2007-03-14  0:57 ` defadvice on garbage-collect doesnt work? John Paul Wallington
2007-03-14  7:08   ` Tim X
2007-03-14 23:45     ` Oliver Scholz
2007-03-14 23:51     ` joakim
2007-03-13 21:37 joakim

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 read-only IMAP folder(s) and NNTP newsgroup(s).