Commit 90ace87
committed
Account for input hash vector in construction memory estimate
estimate_num_bytes_for_construction returned max(map_bytes, search_bytes),
but the input hash vector lives across both phases. The partitioned
external builder pushes the per-partition hashes (num_keys *
sizeof(hash_type)) into in_memory_partitions and only adds the build
estimate to its running 'bytes' counter, so the bytes < config.ram gate
underestimated true residency by num_keys * sizeof(hash_type) per
partition.
For hash128 (16B) plus the search-phase peak (~25B/key), peak per-
partition residency is ~41B/key while the gate believed ~25B/key, so
config.ram=2GiB actually allowed ~3.2GB resident. Adding the input
hashes outside the max makes config.ram match observed RSS.1 parent e04a192 commit 90ace87
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
| |||
0 commit comments