commit 345f650943608219909e5b5b0e5d77c4c9ca26bb from: Stefan Sperling via: Thomas Adam date: Tue Nov 08 20:14:11 2022 UTC reduce delta cache size to avoid running out of memory on large pack files As reported by Jerome Kasper, got-index-pack would run out of memory while cloning projects like LLVM or the Linux kernel. The delta cache was pushed to its maximum size limit of ~2GB, which is much higher than the default user data limit on OpenBSD. Set the delta cache size limits to values which should result in the cache limiting itself to 128MB or less. commit - b5a8f7447cf93c910aa0933817b85799080ce17d commit + 345f650943608219909e5b5b0e5d77c4c9ca26bb blob - 992589e88058863df9f7e4e96234707a1c00b4ac blob + 688a6e57f5be05fe9d93c7fef20f787f9e540f6a --- lib/delta_cache.c +++ lib/delta_cache.c @@ -40,9 +40,9 @@ #endif #define GOT_DELTA_CACHE_MIN_BUCKETS 64 -#define GOT_DELTA_CACHE_MAX_BUCKETS 16384 +#define GOT_DELTA_CACHE_MAX_BUCKETS 2048 #define GOT_DELTA_CACHE_MAX_CHAIN 2 -#define GOT_DELTA_CACHE_MAX_DELTA_SIZE 2048 +#define GOT_DELTA_CACHE_MAX_DELTA_SIZE 1024 struct got_cached_delta { off_t offset;