Date: Tue, 3 Mar 2015 03:29:17 +0300 From: rozhuk.im@gmail.com To: "'Dmitry Sivachenko'" <trtrmitya@gmail.com>, <hackers@freebsd.org> Cc: 'Konstantin Belousov' <kib@FreeBSD.org> Subject: RE: mmap() question Message-ID: <54f5005f.272d700a.09bb.ffffce64@mx.google.com> In-Reply-To: <E84D65C4-6E90-4C65-925C-F5239A612C4B@gmail.com> References: <95E0B821-BF9B-4EBF-A1E5-1DDCBB1C3D1B@gmail.com> <E84D65C4-6E90-4C65-925C-F5239A612C4B@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > I have a program which mmap()s a lot of large files (total size more > that RAM and I have no swap), but it needs only small parts of that > files at a time. > > > > My understanding is that when using mmap when I access some memory > region OS reads the relevant portion of that file from disk and caches > the result in memory. If there is no free memory, OS will purge > previously read part of mmap'ed file to free memory for the new chunk. > > > > But this is not the case. I use the following simple program which > gets list of files as command line arguments, mmap()s them all and then > selects random file and random 1K parts of that file and computes a XOR > of bytes from that region. > > After some time the program dies: > > pid 63251 (a.out), uid 1232, was killed: out of swap space My PR with same: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195882 "this is not bug" - say some devs.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54f5005f.272d700a.09bb.ffffce64>