all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Memory leaks
@ 2009-08-05 17:17 Daniel Clemente
  2009-08-08 18:57 ` Chong Yidong
  0 siblings, 1 reply; 44+ messages in thread
From: Daniel Clemente @ 2009-08-05 17:17 UTC (permalink / raw)
  To: emacs-devel


  Hi, today my Emacs --daemon from CVS started eating memory and ended up with 1 Gb resident and 2'5 Gb virtual, with only 180 small buffers open.

  I wanted to debug who was taking all this memory. Since I don't know how to find out this, I have started to collect more information in EmacsWiki: http://www.emacswiki.org/emacs/EmacsMemoryDebugging

  How do you debug memory leaks? Please add tips there so that they are useful to more people.

  Thanks

-- Daniel






^ permalink raw reply	[flat|nested] 44+ messages in thread
* Memory leaks
@ 2011-03-03 17:13 Uday S Reddy
  2011-03-03 17:55 ` Andreas Schwab
  0 siblings, 1 reply; 44+ messages in thread
From: Uday S Reddy @ 2011-03-03 17:13 UTC (permalink / raw)
  To: emacs-devel

I am trying to track down some possible memory leaks in VM.  I have been 
assuming that, when a buffer gets killed,

- all its string memory is reclaimed,

- all the buffer-local variables are reclaimed, and

- all the overlays and intervals are reclaimed.

Are any of these assumptions invalid?  If so, what can I do about the 
lost memory?

Cheers,
Uday




^ permalink raw reply	[flat|nested] 44+ messages in thread
* memory leaks
@ 2019-09-20  7:23 Madhu
  2019-09-20  8:00 ` Jean-Christophe Helary
  2019-09-20  8:11 ` Eli Zaretskii
  0 siblings, 2 replies; 44+ messages in thread
From: Madhu @ 2019-09-20  7:23 UTC (permalink / raw)
  To: help-gnu-emacs


There is obviously some memory leak in emacs and I don't know how to
trace the culprit.  Emacs lops up 2GB RSS: ps axuw |grep emacs

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
madhu     5434  6.9 54.2 2235612 2115564 ?     SNsl Sep19  66:42 emacs --daemon --debug-init

(garbage-collect) shows

((conses 16 981544 136697)
 (symbols 48 56864 5)
 (strings 32 312273 12669)
 (string-bytes 1 18002558)
 (vectors 16 68285)
 (vector-slots 8 1780950 150102)
 (floats 8 1089 2405)
 (intervals 56 6605 2469)
 (buffers 992 79))

So does this look like a X fonts issue?  How can I figure out which
package is the culprit.

1. Emacs has a bug where I can't look at /proc/5434/emacs from within
emacs it will only read 16384 bytes from the proc filesystem

2. Trying to Unload a feature hits all sorts of design and
implementation bugs with the cl-generics scourge which is unfortunately
used to implement emacs.  Is unloading features likely to help at all in
reducing the memory and getting a clue about the errant package?







^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: memory leaks
@ 2020-11-10  1:24 Madhu
  2020-11-10 15:16 ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Madhu @ 2020-11-10  1:24 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: 43395

[Test case follows. Sorry Drew for trying to post to help-gnu and
debbugs simultaneously, but this is my third attempt at sending this
test case - I've tried sending it to debbugs.gnu.org and to
gmane.emacs.help newsgroup - and my messages have been dropped]


* Madhu <m35z8gise6.fsf@leonis4.robolove.meer.net> :
Wrote on Mon, 14 Sep 2020 15:36:57 +0530:
> The numbers I reported by garbage-collect do not account for the memory
> usage. FWIW I've posted that info again at
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43395

I found test case for this bug and I sent mail to 43395@debbugs.gnu.org,
and qmail told me that the mail was accepted:
delivery 1: success:
209.51.188.43_accepted_message./Remote_host_said:_250_OK_id=1kc8Bf-00061T-3u/
But the bugreport didn't show up on gnu.emacs.bug.

Here is the test case:

#+BEGIN_SRC
$ cat > f.c
#include <stdio.h>
int
main()
{
  char c = ' ';
  while (c != 'q' && c != 'Q')
    {
      fprintf(stdout, "Press q then enter to quit: ");
      c = fgetc(stdin);
    }
  return 0;
}
^D

$ gcc f.c
$ emacs -Q
#+END_SRC

M-x shell-command ./a.out

Then the process hangs. But Emacs' memory grows unbounded.

WARNING. Be careful to interrupt it with ^G before the OOM killer
kicks in.  If you have swap you may lose control of your machine
indefinitely.

After you interrupt the sub process, Emacs is left with unreclaimed
gigabytes of RSS

Please let me know if you can reproduce this



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

end of thread, other threads:[~2022-03-06 11:15 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05 17:17 Memory leaks Daniel Clemente
2009-08-08 18:57 ` Chong Yidong
2009-08-10  8:08   ` Daniel Clemente
  -- strict thread matches above, loose matches on Subject: below --
2011-03-03 17:13 Uday S Reddy
2011-03-03 17:55 ` Andreas Schwab
2011-03-03 18:00   ` Uday S Reddy
2011-03-03 23:40     ` Andreas Schwab
2011-03-04 11:39       ` Uday S Reddy
2011-03-04 12:19         ` Eli Zaretskii
2011-03-04 12:59           ` Uday S Reddy
2011-03-07 19:19         ` Uday S Reddy
2011-03-07 20:33           ` Andreas Schwab
2011-03-07 22:27             ` David Kastrup
2011-03-07 22:49               ` David Kastrup
2011-03-09  0:39               ` Richard Stallman
2011-03-07 23:01             ` Uday S Reddy
2011-03-08  2:35               ` Stefan Monnier
2011-03-08  8:57                 ` Andreas Schwab
2011-03-09  0:40                   ` Richard Stallman
2011-03-09  6:07                     ` David Kastrup
2019-09-20  7:23 memory leaks Madhu
2019-09-20  8:00 ` Jean-Christophe Helary
2019-09-20  8:11 ` Eli Zaretskii
     [not found]   ` <mailman.572.1568967069.2190.help-gnu-emacs@gnu.org>
2019-09-20  8:31     ` Madhu
2019-09-20  9:21       ` Eli Zaretskii
     [not found]         ` <mailman.578.1568971399.2190.help-gnu-emacs@gnu.org>
2020-09-12 13:02           ` Madhu
2020-09-12 13:39             ` Eli Zaretskii
2020-09-12 13:55               ` Michael Heerdegen
2020-09-12 14:09                 ` Eli Zaretskii
2020-09-12 19:14               ` Igor Sosa Mayor
2020-09-12 19:26                 ` Eli Zaretskii
2020-09-12 19:28                   ` Igor Sosa Mayor
2020-09-13  2:30                     ` Eli Zaretskii
2020-09-13  3:17                   ` Madhu
2020-09-13 14:14                     ` Eli Zaretskii
2021-01-21  9:28                       ` Madhu
2020-09-13 20:14                     ` Stefan Monnier
2020-09-14 10:06                       ` Madhu
2020-11-09 17:50                         ` Madhu
2022-03-04 11:32                           ` Eli Zaretskii
2022-03-06 10:59                             ` Madhu
2022-03-06 11:15                               ` Eli Zaretskii
2020-11-10  1:24 Madhu
2020-11-10 15:16 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.