On Wed, 9 Jul 2003, Juan Rivera wrote: > I figured it has to do something with the way pools work.
Nope, buckets don't allocate anything from pools. > Would it make a difference if the buffer size used is always a multiple > of APR_BUCKET_BUFF_SIZE? Like 16, 32, 64? Lots of the code assumes that things will be done in APR_BUCKET_BUFF_SIZE increments at the most. If you go in multiples of that, it means multiple buckets. The reason is that the bucket allocator hands out 8KB blocks. One of them it carves up into little hunks (I forget how big "little" is exactly, but it's something on the order of 64 bytes), and the others it hands out as-is. > Do you know where the 8K number come from? Is it an empirical number or > a theoretical one? The buffer size is not 8K... it's 8000. 8K is what's actually allocated, but some of that is used internally by the bucket allocator. The reason is that 4KB or 8KB tend to be the size of VM pages. We went with 8KB to try to balance computational overhead with memory overhead. I still don't see what problem you're trying to solve, though, by wanting a configurable buffer size? --Cliff
