[lkml]   [1997]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Big malloc's.
   Date: 	Mon, 10 Feb 1997 13:44:51 +0200 (SAT)
From: John Carter <>

Suppose I want to move through a _lot_ of data quickly. A really
big file (up to several times the size of memory+swap). Typically I
malloc() a BIG array, read() the file into that array and off I
go. If the array is too big, I start swapping like mad. Slow.

Thus its better if I chop it into buffers. The question is, how big
a buffer. The smaller the buffer, the more read()'s and the more
fiddling with buffer boundary conditions I do. Too big a buffer and
I start swapping.

Why not use mmap?

 \ /
  Last update: 2005-03-22 13:38    [W:0.031 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site