commit 99f7567eaa6fad9b271f55d1469fcd383bb13205 from: Stefan Sperling date: Tue Nov 08 12:39:36 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 - 22f6beb0dae033aa1e023e1d849d5cede058e002 commit + 99f7567eaa6fad9b271f55d1469fcd383bb13205 blob - 7040864a05c512e8185f1db76e4230360addabfe blob + 764a86ea44c7cb639fc39ffdaca2a0f3db638d9e --- 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;