[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: putting "/tmp" to memory help



On Tue, 25 Jan 2011 21:35:41 +0100
Sven Joachim <svenjoac@gmx.de> wrote:

> On 2011-01-25 21:03 +0100, Celejar wrote:
> 
> > On Tue, 25 Jan 2011 08:49:57 +0100
> > Sven Joachim <svenjoac@gmx.de> wrote:
> >
> >> On 2011-01-25 02:50 +0100, Celejar wrote:
> >> 
> >> > On Mon, 24 Jan 2011 17:41:07 -0600
> >> > "Boyd Stephen Smith Jr." <bss@iguanasuicide.net> wrote:
> >> >
> >> > ...
> >> >
> >> >> tmpfs doesn't reserve much (if any) memory.  So, unless it is being actively 
> >> >> used by files in the tmpfs, it can be used by other applications.
> >> >
> >> > I'm somewhat confused about this.  My system has 2GB of RAM, and I have:
> >> >
> >> > $ uptime
> >> >  20:46:09 up 5 days,  5:30,  9 users,  load average: 0.06, 0.09, 0.25
> >> >
> >> > $ free
> >> >              total       used       free     shared    buffers     cached
> >> > Mem:       2065172    1047312    1017860          0      66064     357512
> >> > -/+ buffers/cache:     623736    1441436
> >> > Swap:      1949688     102364    1847324
> >> >
> >> > $ df | grep tmp
> >> > tmpfs                  1032584        16   1032568   1% /lib/init/rw
> >> > tmpfs                  1032584         0   1032584   0% /dev/shm
> >> > none                   1032584      2440   1030144   1% /tmp
> >> >
> >> > So my /tmp is using 1GB.
> >> 
> >> No, because more than 99% of the space on /tmp are free.
> >
> > But if that memory isn't actually reserved for the tmpfs filesystem, and
> > is actually available for other uses (until /tmp fills up), than
> > shouldn't that memory either be reported as 'free' by free, or used for
> > disk caching, etc., and therefore be reported as 'used'?
> 
> I'm not sure I can parse this correctly.  If you're referring to half of
> your memory being free, that's certainly a bit unusual, but it probably

Yes.

> can be explained.  Maybe you hibernated your system in the five days
> it's been up, or you were watching a DVD and ejected the media.  Or you
> have just terminated a process that used a lot of RAM.

You're right; I see now that 'free' reports only 317376 free.  This is
a laptop, and I do hibernate it a couple of times a day, so I suppose
that the cache(s) are thrown away to use the RAM for hibernation (and
to avoid pointlessly saving cached disk data in RAM back to disk), and
then when the system is restored, the RAM becomes free again until it's
once again used for cache or application storage?

Celejar
-- 
foffl.sourceforge.net - Feeds OFFLine, an offline RSS/Atom aggregator
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


Reply to: