Subject: Re: mmap eats memory
To: Andrew Kilpatrick <email@example.com>
From: Darren Reed <firstname.lastname@example.org>
Date: 02/20/2001 18:04:55
In some email I received from Andrew Kilpatrick, sie wrote:
> 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.