title: unbuffered I/O in Linux
body: <p>I'm writing lots and lots of data that will not be read again for weeks - as my program runs the amount of free memory on the machine (displayed with 'free' or 'top') drops very quickly,   the amount of memory my app uses does not increase - neither does the amount of memory used by other processes.</p>
  
  <p>This leads me to believe the memory is being consumed by the filesystems cache - since I do not intend to read this data for a long time I'm hoping to bypass the systems buffers, such that my data is written directly to disk.  I dont have dreams of improving perf or being a super ninja, my hope is to give a hint to the filesystem that I'm not going to be coming back for this memory any time soon,  so dont spend time optimizing for those cases.</p>
  
  <p>On Windows I've faced similar problems and fixed the problem using FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH  - the machines memory was not consumed by my app and the machine was more usable in general.  I'm hoping to duplicate the improvements I've seen but on Linux.  On Windows there is the restriction of writing in sector sized pieces, I'm happy with this restriction for the amount of gain I've measured.</p>
  
  <p>is there a similar way to do this in Linux?  </p>