Skip to content

Commit

Permalink
Merge branch 'np/maint-limit-delta-cache'
Browse files Browse the repository at this point in the history
* np/maint-limit-delta-cache:
  don't let the delta cache grow unbounded in 'git repack'
  • Loading branch information
Junio C Hamano committed Aug 11, 2009
2 parents 6eedee5 + 5749b0b commit efd3f9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,20 @@ pack.compression::

pack.deltaCacheSize::
The maximum memory in bytes used for caching deltas in
linkgit:git-pack-objects[1].
A value of 0 means no limit. Defaults to 0.
linkgit:git-pack-objects[1] before writing them out to a pack.
This cache is used to speed up the writing object phase by not
having to recompute the final delta result once the best match
for all objects is found. Repacking large repositories on machines
which are tight with memory might be badly impacted by this though,
especially if this cache pushes the system into swapping.
A value of 0 means no limit. The smallest size of 1 byte may be
used to virtually disable this cache. Defaults to 256 MiB.

pack.deltaCacheLimit::
The maximum size of a delta, that is cached in
linkgit:git-pack-objects[1]. Defaults to 1000.
linkgit:git-pack-objects[1]. This cache is used to speed up the
writing object phase by not having to recompute the final delta
result once the best match for all objects is found. Defaults to 1000.

pack.threads::
Specifies the number of threads to spawn when searching for best
Expand Down
2 changes: 1 addition & 1 deletion builtin-pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static int pack_compression_level = Z_DEFAULT_COMPRESSION;
static int pack_compression_seen;

static unsigned long delta_cache_size = 0;
static unsigned long max_delta_cache_size = 0;
static unsigned long max_delta_cache_size = 256 * 1024 * 1024;
static unsigned long cache_max_small_delta_size = 1000;

static unsigned long window_memory_limit = 0;
Expand Down

0 comments on commit efd3f9f

Please sign in to comment.