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

very large ram disk problems -- swapping, caching, and why tmpfs and not ext2 or reiserfs


About a year ago a gent named Brandon posted a note to this list stating
that, with kernel 2.6.9, when he created a very large ram disk using ext2 or
reiserfs and filled it up his system hung.  Here's his note...

The recommendation was to switch to using tmpfs.

I'm having the same problem.  I'm using, and I'm attempting to
mount a 2 GB ram disk.  As recommended in the original note series, tmpfs
does work, where ext2 and reiserfs don't, but I'm not sure it's actually
what we want, and I'd like to understand a bit more about why tmpfs works
(and haven't been able to find explanations).

So I have several questions...

1.  When I fill my ext2 or reiserfs ram disk (but not tmpfs) to the 1 GB
point, the system complains that it has insufficient memory, kills some
processes, and hangs.  It responds to ping, but that's about it.  I have 5.5
GB of memory still free, at that point, and I'm not running any of my own
software.  Why does using ext2 or reiserfs result in insufficient memory
when it appears I still have memory left, and why does tmpfs not suffer the
same fate? 

2.  I understand, through the "grape vine" that a ram disk built with tmpfs
can have its contents swapped.  I also understand this is not true of ext2
or reiserfs.

Is that correct?    

My primary concern with using tmpfs has to do with swapping -- I'm using a
ram disk for a variety of reasons, but one of them is to avoid having any
writes to the file system for staging files and to ensure that certain files
are present for processing and don't need to be re-loaded.  Swapping defeats
that purpose. I can't use /tmp because I also need to pre-reserve space.

I could turn swapping off, but would prefer to leave it on.

3.  When I use a ram disk I have noticed that the files I write to the ram
disk also seem to appear in the file cache.  I believe this is true
primarily due to indirect observation -- when I write 100 MB to my RAM disk
I have 200 MB consumed.  Is that correct?  Is there some way to avoid the
extra caching?


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.12/461 - Release Date: 10/2/2006

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