From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Weird memory consumption libnked to frame font spec
Date: Fri, 24 Apr 2009 00:00:36 -0400 [thread overview]
Message-ID: <jwvocumafgh.fsf-monnier+emacs@gnu.org> (raw)
There's something funny with our memory consumption.
Here is a recipe to show the problem, tho it uses mpc.el (and requires
an mpd daemon running), so you may find it rather inconvenient to try
and reproduce it. Hopefully I'll find a way to get rid of this mpc.el
dependency to reproduce the bug, but for now, that's what we have:
- emacs -Q --eval '(dotimes (i 10 (other-frame 1)) (make-frame (quote ((font . "Sans")))))' -l ~/src/elisp/mpc/mpc.el -f mpc
- at this point, you're supposed to be looking at 11 frames, the bottom
one using the default font to show *scratch*, the 9 middle ones
showing *scratch* as well but using "Sans", and the top one also using
"Sans" but showing various windows listing the
artists&albums&... available in your MPD daemon.
"ps" should show your Emacs process is largish, but not humongous (in
my case it's about 60MB).
- Now middle click on some artist in the artist list to select it.
This should modify most of the buffers in the MPC frame, tho nothing
really particular: they don't get much longer, they don't use new
charsets (they may, but at least in my test case they don't), ...
This is done by sending various commands to the MPD daemon (via one
TCP connection) and receiving responses in return through the
process filter.
Yet, the process size of this running Emacs has jumped up by an
enormous chunk (to 190MB in my case).
Now you might think "well, now, this mpc.el of yours is doing something
really fishy to eat up so much memory". But as turns out, If I repeat
this test but passing nil to make-frame rather than (quote ((font
. "Sans"))), the memory use is a bit lower to start with (like 58MB
instead of 60MB) and rather than jump up to 190MB it only slightly
increases to 59MB. Also the data returned by `garbage-collect' seems to
indicate that most of that memory is not spent on Lisp data. So the
problem seems linked to the handling of fonts rather than to mpc.el.
Even without this bug, I find that every frame I create causes the
memory size to jump by almost 1MB, which I find rather large but
maybe explainable. OTOH this jump in size really looks like a bug.
Stefan
next reply other threads:[~2009-04-24 4:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-24 4:00 Stefan Monnier [this message]
2009-04-24 4:27 ` Weird memory consumption libnked to frame font spec Kenichi Handa
2009-05-01 2:58 ` Stefan Monnier
2009-05-01 12:15 ` Kenichi Handa
2009-05-01 19:47 ` Stefan Monnier
2009-05-20 23:13 ` Chong Yidong
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=jwvocumafgh.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.