git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC PATCH] index-pack: Issue a warning if deltaBaseCacheLimit is too small

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jul 17, 2008, 22:02 UTC
Message-ID
<20080717220251.GA3072@spearce.org>
In-Reply-To
<20080717213550.GA2798@spearce.org>

Its rare that we should exceed deltaBaseCacheLimit while resolving delta compressed objects. By default this limit is 16M, and most chains are under 50 objects in length. This affords about 327K per object in the chain, which is quite large by source code standards.

If we have to recreate a prior delta base because we evicted it to stay within the deltaBaseCacheLimit we can warn the user that their configured limit is perhaps too low for this repository data set. If the user keeps seeing the warning they can research it in the documentation, and consider setting it higher on this repository, or just globally on their system.

Suggested-by: Stephan Hennig <mailing_list@arcor.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 index-pack.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/index-pack.c b/index-pack.c
index ac20a46..97533d6 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -53,6 +53,7 @@ static struct object_entry *objects;
 static struct delta_entry *deltas;
 static struct base_data *base_cache;
 static size_t base_cache_used;
+static int oom_warning;
 static int nr_objects;
 static int nr_deltas;
 static int nr_resolved_deltas;
@@ -481,6 +482,13 @@ static void *get_base_data(struct base_data *c)
 	if (!c->data) {
 		struct object_entry *obj = c->obj;
 
+		if (!oom_warning && verbose) {
+			if (progress)
+				fputc('\n', stderr);
+			warning("One or more delta chains are larger than deltaBaseCache.");
+			oom_warning = 1;
+		}
+
 		if (obj->type == OBJ_REF_DELTA || obj->type == OBJ_OFS_DELTA) {
 			void *base = get_base_data(c->base);
 			void *raw = get_data_from_pack(obj);
-- 
1.5.6.3.569.ga9185
Previous: Shawn O. PearceNext: Nicolas Pitre
Message 47 of 51 in “git pull is slow”
  1. Stephan HennigJul 10, 2008
  2. Martin LanghoffJul 10, 2008
  3. Petr BaudisJul 10, 2008
  4. Johannes SixtJul 10, 2008
  5. Stephan HennigJul 10, 2008
  6. Petr BaudisJul 10, 2008
  7. Stephan HennigJul 10, 2008
  8. Stephan HennigJul 11, 2008
  9. Andreas EricssonJul 11, 2008
  10. Johannes SchindelinJul 11, 2008
  11. Stephan HennigJul 12, 2008
  12. Johannes SchindelinJul 12, 2008
  13. Shawn O. PearceJul 13, 2008
  14. Johannes SchindelinJul 13, 2008
  15. Shawn O. PearceJul 13, 2008
  16. 0/4 Honor core.deltaBaseCacheLimit during index-packShawn O. Pearce, Jul 14, 2008
  17. 1/4 index-pack: Refactor base arguments of resolve_delta into a structShawn O. Pearce, Jul 14, 2008
  18. 2/4 index-pack: Chain the struct base_data on the stack for traversalShawn O. Pearce, Jul 14, 2008
  19. 3/4 index-pack: Track the object_entry that creates each base_dataShawn O. Pearce, Jul 14, 2008
  20. 4/4 index-pack: Honor core.deltaBaseCacheLimit when resolving deltasShawn O. Pearce, Jul 14, 2008
  21. Nicolas PitreJul 15, 2008
  22. Shawn O. PearceJul 15, 2008
  23. index-pack: Honor core.deltaBaseCacheLimit when resolving deltasShawn O. Pearce, Jul 15, 2008
  24. Nicolas PitreJul 15, 2008
  25. Junio C HamanoJul 15, 2008
  26. Johannes SchindelinJul 14, 2008
  27. Nicolas PitreJul 15, 2008
  28. Shawn O. PearceJul 15, 2008
  29. Nicolas PitreJul 15, 2008
  30. Nicolas PitreJul 15, 2008
  31. Nicolas PitreJul 15, 2008
  32. Nicolas PitreJul 14, 2008
  33. Shawn O. PearceJul 14, 2008
  34. Johannes SchindelinJul 14, 2008
  35. Jakub NarebskiJul 14, 2008
  36. Johannes SchindelinJul 14, 2008
  37. Andreas EricssonJul 14, 2008
  38. Johannes SchindelinJul 14, 2008
  39. Andreas EricssonJul 14, 2008
  40. Johannes SchindelinJul 14, 2008
  41. Nicolas PitreJul 15, 2008
  42. Shawn O. PearceJul 15, 2008
  43. Nicolas PitreJul 15, 2008
  44. Stephan HennigJul 17, 2008
  45. Nicolas PitreJul 17, 2008
  46. Shawn O. PearceJul 17, 2008
  47. index-pack: Issue a warning if deltaBaseCacheLimit is too smallShawn O. Pearce, Jul 17, 2008
  48. Nicolas PitreJul 17, 2008
  49. Shawn O. PearceJul 15, 2008
  50. Stephan HennigJul 13, 2008
  51. Stephan HennigJul 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.