After some testing, it seems each object sha1 we need to cache while writing
a pack costs us about 83 bytes of memory. (This isn't so great, so
optimizing it in C later could cut this down a lot.) The new limit of 200k
objects takes about 16.6 megs of RAM, which nowadays is pretty acceptable.
It also corresponds to roughly 1GB of packfile for my random select of
sample data, so (since the default packfile limit is about 1GB anyway), this
*mostly* won't matter.
It will have an effect if your data is highly compressible, however; an
8192-byte object could compress down to a very small size and you'd end up
with a large number of objects. The previous default limit of 10 million
objects was ridiculous, since that would take 830 megs of RAM.
f = self.file
if not f: return None
self.file = None
+ self.objcache = None
# update object count
f.seek(8)
f.write(sum.digest())
f.close()
- self.objcache = None
p = subprocess.Popen(['git', 'index-pack', '-v',
'--index-version=2',
BLOB_MAX = BLOB_LWM*2
BLOB_HWM = 1024*1024
split_verbosely = 0
-max_pack_size = 1000*1000*1000
-max_pack_objects = 10*1000*1000
+max_pack_size = 1000*1000*1000 # larger packs will slow down pruning
+max_pack_objects = 200*1000 # cache memory usage is about 83 bytes per object
fanout = 4096
class Buf: