diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-03-19 01:14:37 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-18 22:43:37 -0700 |
commit | 18bdec1118df92649b70ce126aff2f147deecad5 (patch) | |
tree | b4b4221974d0f4f48b32c3168365807e652caf5e /environment.c | |
parent | 3635a187704ed30b32eb11f5098496e5e435a19d (diff) | |
download | git-18bdec1118df92649b70ce126aff2f147deecad5.tar.gz |
Limit the size of the new delta_base_cache
The new configuration variable core.deltaBaseCacheLimit allows the
user to control how much memory they are willing to give to Git for
caching base objects of deltas. This is not normally meant to be
a user tweakable knob; the "out of the box" settings are meant to
be suitable for almost all workloads.
We default to 16 MiB under the assumption that the cache is not
meant to consume all of the user's available memory, and that the
cache's main purpose was to cache trees, for faster path limiters
during revision traversal. Since trees tend to be relatively small
objects, this relatively small limit should still allow a large
number of objects.
On the other hand we don't want the cache to start storing 200
different versions of a 200 MiB blob, as this could easily blow
the entire address space of a 32 bit process.
We evict OBJ_BLOB from the cache first (credit goes to Junio) as
we want to favor OBJ_TREE within the cache. These are the objects
that have the highest inflate() startup penalty, as they tend to
be small and thus don't have that much of a chance to ammortize
that penalty over the entire data.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'environment.c')
-rw-r--r-- | environment.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/environment.c b/environment.c index fff4a4da50..22316597df 100644 --- a/environment.c +++ b/environment.c @@ -27,6 +27,7 @@ const char *apply_default_whitespace; int zlib_compression_level = Z_DEFAULT_COMPRESSION; size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE; size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT; +size_t delta_base_cache_limit = 16 * 1024 * 1024; int pager_in_use; int pager_use_color = 1; int auto_crlf = 0; /* 1: both ways, -1: only when adding git objects */ |