Sorry for cross-list messaging. But I use SuSe on both i686 and 64bit. On Thu, 2005-07-07 at 11:48 +0200, Andi Kleen wrote:
On Wed, Jul 06, 2005 at 03:59:32PM -0700, Brad Dameron wrote:
We have a in-house application that uses mmap to pull a file into memory. I can't seem to find any info on where this file is stored in memory. I know that it is shared memory. But does the /dev/shm have anything to do with it. Isn't shm just a tmpfs? Also can shm be
Not directly no. Yes.
disabled? I have a machine with 16GB and 8GB then goes to the shm. Does
Yes, but you probably don't need to.
It just means that shm could grow upto 8GB if someone put that much data into it by creating files in it. Normal mmap doesn't do that.
this only allow mmap to use the other 8GB or is all 16GB accessible to it? These are the questions I have been trying to figure out for over a
All 16GB accessible for it. Actually a few percent less because there are some other data structures like page tables that need to fit into memory too.
week now. Not many answers on google and no one has seemed to ask this before.
Also is mmap the fastest way to get a file from disk to memory?
It depends. Normal read() does more aggressive readahead which can be faster. However mmap() won't copy and you cache the data only once.
-Andi
Andi, First thanks for your response. If I mmap say a 1GB file, then I mmap another 1GB file. It will then have both files in memory correct? And how long will it keep them in memory? Also I noticed it uses PAGE_SIZE as the block size to grab the files in. Is there a way to increase this just for mmap or is the default of 4096kB a good size to use. We mainly deal with 100MB to 5GB file sizes. Nothing really small. And usually everything sequential. Any further answer's appreciated. Thank you, Brad Dameron SeaTab Software www.seatab.com
participants (1)
-
Brad Dameron