|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Buffer Size Limit - Rule Of ThumbIs there a rule of thumb to determine the largest size a buffer should be?
e.g 10% of available RAM. Does VB6 have a limit (say 2G max). I am reading a large file and looking a individual bytes within the buffer. Currently I use a multiple of the bytes per sector (around 16Mbyte buffer). Wondering if there is any advantage to going larger? Lorin <Lo***@discussions.microsoft.com> wrote:
> Is there a rule of thumb to determine the largest size a buffer should be? Windows limits each process to 2Gb of address space. (With one notable exception > e.g 10% of available RAM. > Does VB6 have a limit (say 2G max). that you should never expect on machines not under your direct control.) > I am reading a large file and looking a individual bytes within the buffer. Probably not, hard to say. Kinda doubtful.> Currently I use a multiple of the bytes per sector (around 16Mbyte buffer). > Wondering if there is any advantage to going larger? On Thu, 10 May 2007 16:46:04 -0700, =?Utf-8?B?TG9yaW4=?=
<Lo***@discussions.microsoft.com> wrote: >Is there a rule of thumb to determine the largest size a buffer should be? I've found that the advantages of large buffers tend to tail off>e.g 10% of available RAM. >Does VB6 have a limit (say 2G max). >I am reading a large file and looking a individual bytes within the buffer. >Currently I use a multiple of the bytes per sector (around 16Mbyte buffer). >Wondering if there is any advantage to going larger? pretty rapidly - around the 100kb level I don't think I've ever used as much as 1mb With lines of say 100 bytes a 100kb buffer reduces 1000 disk accesses to 1 disk access - 10 disk accesses per megabyte is barely noticable The problem with large buffers is that they may cause swap file thrashing "Lorin" <Lo***@discussions.microsoft.com> wrote in message I performed a few tests, mostly out of idle curiosity, a couple of weeks news:017C7C6D-8DD9-4796-9005-DAA022564A84@microsoft.com... > Is there a rule of thumb to determine the largest size a buffer > should be? e.g 10% of available RAM. Does VB6 have a > limit (say 2G max). I am reading a large file and looking a > individual bytes within the buffer. Currently I use a multiple > of the bytes per sector (around 16Mbyte buffer). > Wondering if there is any advantage to going larger? ago. I can't remember the exact result but I don't think I saw any significant benefit in going much above a couple of Mbytes. Going too high can often prove counter productive. Mike |
|||||||||||||||||||||||