reduce the amount of memory used for caching deltas during deltification With files sorted properly for deltification we produce better deltas but end up consuming more memory and risk running into OpenBSD ulimits during packing. To compensate, reduce the threshold for the amount of delta data we store in memory, spooling more deltas into the cache file. ok op@
diff --git a/lib/pack_create.c b/lib/pack_create.c
index 8cc2b39..2033988 100644
--- a/lib/pack_create.c
+++ b/lib/pack_create.c
@@ -681,7 +681,7 @@ pick_deltas(struct got_pack_meta **meta, int nmeta, int ncolored,
off_t size, best_size;
const int max_base_candidates = 3;
size_t delta_memsize = 0;
- const size_t max_delta_memsize = 25 * GOT_DELTA_RESULT_SIZE_CACHED_MAX;
+ const size_t max_delta_memsize = 4 * GOT_DELTA_RESULT_SIZE_CACHED_MAX;
int outfd = -1;
qsort(meta, nmeta, sizeof(struct got_pack_meta *), delta_order_cmp);