From: Daniel Gryniewicz <dang@fprintf.net>
To: Maciej Zenczykowski <maze@cela.pl>
Cc: Jose Luis Domingo Lopez <linux-kernel@24x7linux.com>,
linux-kernel@vger.kernel.org
Subject: Re: Over used cache memory?
Date: Thu, 06 Nov 2003 15:50:34 -0500 [thread overview]
Message-ID: <1068151833.3901.20.camel@localhost> (raw)
In-Reply-To: <Pine.LNX.4.44.0311062051270.21501-100000@gaia.cela.pl>
[-- Attachment #1: Type: text/plain, Size: 2672 bytes --]
On Thu, 2003-11-06 at 14:57, Maciej Zenczykowski wrote:
> > On Thursday, 06 November 2003, at 17:15:33 +0800,
> > Wee Teck Neo wrote:
> >
> > > procs memory swap io system
> > > cpu
> > > r b w swpd free buff cache si so bi bo in cs us sy id
> > > 1 0 0 92744 9640 20240 801644 0 0 3 10 17 0 25 2 10
> > >
> > > The system is having 1GB ram and currently using 92MB as swap. Why does the
> > > system use the slower swap when there are still memory available (as
> > > cache). Anyway to "force" the system to use more ram instead of putting
> > > into swap memory?
>
> Why would you want to? The kernel has determined that 92MB of the stuff
> in memory is less important than the disk cache. For example a program
> requires 100 MB data for boot and then spends the next week using the last
> 5 MB. Do you expect all 100 MB to stay resident in memory for ever
> (while the program is running)? Of course not, it'll get swapped out once
> it is determined to be less used than the disk cache and only that last 5
> MB which is actually doing something will remain in RAM, with the rest
> quietly sitting in swap. Swap is slower than RAM, sure, but using RAM for
> storing your dirty laundry from two weeks ago is pointless - and that's
> why it's swapped out - the disk cache will likely accelerate stuff more
> than keeping the odds and ends in memory.
Because your mozilla and evolution got swapped out overnight in favor of
cache touched by updatedb? Then, when you get in in the morning, your
mozilla and evolution take forever to swap in, which is very annoying.
Frankly, I don't care at all if the updatedb takes slightly longer due
to less cache space, as long as my evolution and mozilla are not swapped
out. This is why I don't have any swap on my desktop. Responsiveness
of the desktop is much more important to me than any speed-up of
cron-based cache-limited processes.
A possibly better solution to this, in my opinion, would be a way to
mark a working set, which get's swapped in as soon as there's space (ie
as soon as cache get's older than some amount of time). This would
allow mozilla to be swapped out in favor of cache during the night, and
then swapped back in automatically when that cache ages out. Obviously
this would need to be disabled on multiuser systems, but would help, I
believe, on desktops. Then again, I have no time or skill to code it,
so feel free to ignore me completely. :) The "no swap" solution works
great for me.
--
Daniel Gryniewicz <dang@fprintf.net>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2003-11-06 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-06 9:15 Over used cache memory? Wee Teck Neo
2003-11-06 19:07 ` Jose Luis Domingo Lopez
2003-11-06 19:57 ` Maciej Zenczykowski
2003-11-06 20:50 ` Daniel Gryniewicz [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-11-06 9:33 Wee Teck Neo
[not found] <BAY4-F18tJyMmxsywxZ00005d1a@hotmail.com>
2003-11-06 9:16 ` Jerry Lundström
2003-11-06 8:05 Wee Teck Neo
2003-11-06 8:25 ` Nick Piggin
2003-11-06 8:59 ` Jerry Lundström
2003-11-06 9:11 ` Helge Hafting
2003-11-06 13:40 ` jlnance
2003-11-06 14:14 ` Gianni Tedesco
2003-11-06 21:47 ` jlnance
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=1068151833.3901.20.camel@localhost \
--to=dang@fprintf.net \
--cc=linux-kernel@24x7linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maze@cela.pl \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox