We want to improve the reservation of the maximum size versus when we should reserve something smaller for the getMore command. Here's a pragmatic approach:
- For a normal cursor with no explicit batch size, 16MB.
- For a normal cursor with explicit batch size, perhaps 8MB.
- For a tailable cursor, which may often return 0 or a small number of results, perhaps 4MB.
We can better fine-tune the above heuristics based on the performance benchmarks in PERF-2565 and PERF-2566. Another worthwhile question that's worth answering as part of this task and its related experiments is that "What happens if we do not do pre-allocation at all"?