all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: How to see where emacs memory goes to
Date: Wed, 29 Jun 2005 12:37:15 -0400	[thread overview]
Message-ID: <jwvd5q5dt5f.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m31x6l8okn.fsf@naru.home> (Joakim Verona's message of "Wed, 29 Jun 2005 12:06:16 +0200")

> My emacs currently consumes 256Mb virtual, and 125Mb resident.
> Its also fairly slow. This happens a lot with my usage pattern.

> Im trying to get a feel for where the memory consumption and slowness
> occur, and Im looking for techniques. Any hints would be apreciated.

> I currently look at these things:
> - m-x garbage-collect to get a baseline
> - how large the buffers are, including "hidden" ones
> - looking at the number of overlays in certain buffers.

> None of these factors seem to come even close to the numbers I get.

You can google for memory-usage.el which basially analyses the output of
garbage-collect and a few more things to give you some info, but it's
probably not going to help you much (it doesn't give you much more info
than garbage-collect, it's just more readable).

I think it would be helpful to try and come up with some better way to track
down such problems, but it's a difficult subject.  One way I can think of is
that in alloc.c we could change mark_object to keep a running count of
the amount of live-memory marked.  Then we could provide a command like
(memory-footprint &rest OBJECTS) which would return the amount of live
memory that would be dead if it weren't for OBJECTS.  It could be
implemented as follows:

   - set the mark bit on all OBJECTS
   - go through the complete normal mark phase
   - set live_memory_count back to 0 and clear the mark bit on OBJECTS
   - call mark_object on all OBJECTS
   - finish the GC by calling ther sweep phase
   - return live_memory_count.

> Currently it seems ERC is causing a lot of the slowness, if not the
> memory consumption.

Try to kill buffers one by one, and watch how the memory-usage change with
each kill.


        Stefan

      reply	other threads:[~2005-06-29 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-29 10:06 How to see where emacs memory goes to Joakim Verona
2005-06-29 16:37 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd5q5dt5f.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.