[[!comment format=mdwn
 username="https://www.google.com/accounts/o8/id?id=AItOawlVUq_c3-lrQBculOEUu3yjvdavE7JbvEI"
 nickname="Stig"
 subject="comment 8"
 date="2014-07-25T10:02:53Z"
 content="""
\"git annex sync\" or \"git annex fsck\" gives me the same problem.  This is an annex which has previously been running with the git annex assistant.

Output is first:

    $ git annex sync
    (merging synced/git-annex into git-annex...)

…then the workstation starts swapping, and after eating 16 GB RAM, and all of 16 GB swap, OOM killer komes for \"git\".

The process which eats up all the memory is:

    git --git-dir=/home/ssm/annex/.git --work-tree=/home/ssm/annex \
      -c core.bare=false log \
      7bed443dc22961214f86e65aedb8861affd215d3..refs/heads/git-annex \
      -n1 --pretty=%H

I _think_ that since a \"-n1\" argument is given, it will only show the log for the last commit in the range, and one could specify \"refs/heads/git-annex\" instead of the range.  With just \"refs/heads/git-annex\" instead of the range, it returns a reference instantly.

The output of git count-objects is

    $ git count-objects -H -v
    count: 334758
    size: 6.27 GiB
    in-pack: 16600
    packs: 1
    size-pack: 1.70 MiB
    prune-packable: 0
    garbage: 0
    size-garbage: 0 bytes

…and there is 1043 files in the annex.
"""]]
