[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory again
From: |
Stefan Monnier |
Subject: |
Re: Memory again |
Date: |
Fri, 16 Dec 2011 16:55:59 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
> But right now, having had emacs up for a few days, and only opening 10
> small files with the aid of emacsclient, emacs's RSS is 130M. It had
> climbed up to 400M before I most recently killed it.
400M definitely sounds like a bug.
> What's the differences between Emacs's and XEmacs's allocators?
I don't think the source of your problem/difference is in the allocator.
> By the way, the dismissal of this being a real problem because Emacs can
> always reuse the fragmented memory either
I don't really dismiss it. My point is rather the following:
- Many memory problems are misdiagnosed as fragmentation problems, where
the real cause is either inefficient memory use, or memory leaks.
- Real fragmentation problems exist but are fairly rare.
- In some "fragmentation" cases, the Emacs process holds on to memory
without any good reason, i.e. it's been "free"d but the malloc library
does not want or can't return it to the OS because it did not use mmap
to allocate it. This can be fixed, but this memory would really be
unused; it can still appear in RSS but only because the memory
pressure hasn't yet bumped it out of RAM. IOW these cases may show
high memory use in terms of VSZ or RSS but fixing them is low priority
because their only direct cost is use of of swap space.
- Fixing the remaining real fragmentation problems probably requires
a different allocator that can move objects to compact the memory
space. Maybe such an allocator can be retrofitted into Emacs
(e.g. a mostly-copying allocator), but noone has tried it yet
(probably because the outcome is hard to predict, the problem it
attempts to fix only occurs rather rarely, and it can be difficult to
ensure that it doesn't affect negatively the more common cases).
So, I know such problems exist in real life, and I would be happy to
accept patches that fix them, but it's not very high on my list
of priorities.
Stefan
- Re: Memory again, (continued)
- Re: Memory again, Óscar Fuentes, 2011/12/06
- Re: Memory again, Stefan Monnier, 2011/12/06
- Re: Memory again, Nix, 2011/12/11
- Re: Memory again, Tim Connors, 2011/12/14
- Re: Memory again, Eli Zaretskii, 2011/12/14
- Re: Memory again, Tim Connors, 2011/12/14
- Re: Memory again, Eli Zaretskii, 2011/12/15
- Re: Memory again, Óscar Fuentes, 2011/12/14
- Re: Memory again, Eli Zaretskii, 2011/12/15
- Re: Memory again,
Stefan Monnier <=
- Re: Memory again, Nix, 2011/12/17
- Re: Memory again, Dmitry Antipov, 2011/12/18
- Re: Memory again, Stefan Monnier, 2011/12/18
- Re: Memory again, Dmitry Antipov, 2011/12/19
- Re: Memory again, Stefan Monnier, 2011/12/19
Re: Memory again, emacs user, 2011/12/19
Re: Memory again, emacs user, 2011/12/20