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

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

Re: How to debug memory leaks


From: Arthur Miller
Subject: Re: How to debug memory leaks
Date: Fri, 26 Mar 2021 16:53:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: help-gnu-emacs@gnu.org
>> Date: Fri, 26 Mar 2021 16:09:33 +0100
>> 
>> > That's what GC does.
>> Yes, but GC can't know if I don't need undo history, right
>
> And neither do you.  GC compacts the undo history, though, and frees
> the slack.

Ok, good if GC compacts the undo, but I could explicitly wish/know
sometimes that I could "freeze" the undo. I could just put on my own
interactive command that does this instead of using
M-: (setq buffer-undo-list nil), but there could be some other stuff
based on mode, like eshell or term or I don't know what. That could help
GC.

>> or old text in eshell buffer?
>
> Delete it, and it will be free'd.

Yes, so that is what I am saying; a hook to put all kind of various
"delete" stuff for various modes so we can run interactive command, say
"clean-buffer" or whatever, and it will run the apropriate "deletes" and
maybe other stuff based on mode.

>> Can we maybe get a "cleanup-hook" so we can specify per mode which
>> data/variables shoudl be set to nil so GC can do it's job?
>
> It's much easier to delete unneeded stuff, and let GC recycle the
> memory.

:-). Yes that is exactly what I ask for; a hook where we could put what
will be deleted and that will be called on user request interactively.

Just as a note: no idea if you have found the memory leak or not, the
big one that everyone was repporting few weeks ago, but I haven't
experienced any leaks or slugishness with lately builds. I guess you
found it? :).



reply via email to

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