GNU bug report logs -
#43389
28.0.50; Emacs memory leaks
Previous Next
Full log
View this message in rfc822 format
* Eli Zaretskii <eliz <at> gnu.org> [2020-11-18 18:04]:
> > Date: Wed, 18 Nov 2020 00:45:48 +0300
> > From: Jean Louis <bugs <at> gnu.support>
> > Cc: eliz <at> gnu.org, fweimer <at> redhat.com, trevor <at> trevorbentley.com,
> > michael_heerdegen <at> web.de, carlos <at> redhat.com, 43389 <at> debbugs.gnu.org
> >
> > Maybe some simple new and automatic function could be temporarily
> > included to spit errors to output on what is Emacs doing when it
> > starts swapping (if it is swapping), then such errors could at least
> > be captured in a file even if I have to reboot computer.
I use now M-x vsize-with-timer for 2GB and M-x good-bye to capture
that basic data.
(defun vsize-value ()
(let* ((attributes (process-attributes (emacs-pid)))
(vsize-name (car (elt attributes 5)))
(vsize-value (cdr (elt attributes 5))))
(list vsize-name vsize-value)))
(defun vsize-check (&optional gb)
(let* ((vsize (cadr (vsize-value)))
(gb (or gb 2))
(gb-1 1048576.0)
(gb (* gb gb-1)))
(when (> vsize gb)
(message "vsize: %.02fG" (/ vsize gb-1)))))
(defun vsize-with-timer (gb)
(interactive "nGiB: ")
(let ((timer (run-with-timer 1 30 'vsize-check gb)))
(message "Timer: %s" timer)))
(defun good-bye ()
(interactive)
(let* ((garbage (garbage-collect))
(size 0)
(buffers-size (dolist (buffer (buffer-list) size)
(setq size (+ size (buffer-size buffer)))))
(uptime (emacs-uptime))
(pid (emacs-pid))
(vsize (vsize-value))
(file (format "~/tmp/emacs-session-%s.el" pid))
(list (list (list 'uptime uptime) (list 'pid pid)
(list 'garbage garbage) (list 'buffers-size buffers-size)
(list 'vsize vsize))))
(with-temp-file file
(insert (prin1-to-string list)))
(message file)))
This bug report was last modified 4 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.