Thread (37 messages) flat view 37 messages, 8 authors, 2016-06-15

Re: git-index-pack really does suck..

From: Chris Lee <hidden>
Date: 2016-06-15 22:43:02

On 4/3/07, Nicolas Pitre [off-list ref] wrote:
On Tue, 3 Apr 2007, Chris Lee wrote:
quoted
There's another issue here.

I'm running git-index-pack as part of a workflow like so:

$ git-verify-pack -v .git/objects/pack/*.idx > /tmp/all-objects
$ grep 'blob' /tmp/all-objects > /tmp/blob-objects
$ cat /tmp/blob-objects | awk '{print $1;}' | git-pack-objects
--delta-base-offset --all-progress --stdout > blob.pack
$ git-index-pack -v blob.pack
Instead of using --stdout with git-pack-object, you should provide it
with a suitable base name for the resulting pack and the index will be
created automatically along side the pack for you.  No need to use
index-pack for that.
Right. But then I wouldn't have discovered how much git-index-pack sucks. :)
quoted
Now, when I run 'git-index-pack' on blob.pack in the current
directory, memory usage is pretty horrific (even with the applied
patch to not leak all everything). Shawn tells me that index-pack
should only be decompressing the object twice - once from the repo and
once from blob.pack - iff I call git-index-pack with --stdin, which I
am not.

If I move the blob.pack into /tmp, and run git-index-pack on it there,
it completes much faster and the memory usage never exceeds 200MB.
(Inside the repo, it takes up over 3G of RES according to top.)
The 3G should definitely be fixed with the added free().
Not really. This packfile is 2.6GB in size, and apparently it gets mmap'd.

(Yesterday, my machine ran out of memory trying to do index-pack when
the memleak still existed; I have 4G of RAM and, normally, 4G of swap,
but I upped it to 32G of swap and it still ran out of memory.)
The CPU usage is explained by the fact that you're running index-pack on
objects that are all already found in your repo so the collision check
is triggered.  This is more or like the same issue as if you tried to
run unpack-objects on the same pack where none of your objects will
actually be unpacked.
Right, and if I was using --stdin, I would expect that. But I'm not.
And, according to Shawn anyway, the current behaviour is not what was
intended.

-clee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help