Subject: Re: mmap eats memory
To: Andrew Kilpatrick <andrew@andrewkilpatrick.org>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: tech-kern
Date: 02/20/2001 18:04:55
In some email I received from Andrew Kilpatrick, sie wrote:
> Hi,
> 
> I'm using mmap to provide access to very large audio
> files. (possibly 300-600 megs) When I scan through an
> entire file, the resident size of my process grows 
> and grows until the RAM on the machine is full and all 
> other processes are swapped to disk. 
> 
> Is this normal? And is there any way of preventing 
> huge memory usage while still giving simple memory-mapped 
> access to very large files? 

This is normal.

Use madvise with MADV_SEQUENTIAL.

Darren