# git gc --prune consumes *lots* of memory with repos cloned with --reference

3 messages from 2009-02-12 to 2009-02-12. Participants: Jon Nelson, Björn Steinbrink.
Thread: https://gitlist.dev/t/17757

## Jon Nelson, 2009-02-12 18:32

Subject: git gc --prune consumes *lots* of memory with repos cloned with --reference
Message-ID: <cccedfc60902121032y17180739r2a049197323d3588@mail.gmail.com>
URL: https://gitlist.dev/e/cccedfc60902121032y17180739r2a049197323d3588%40mail.gmail.com

```
The situation:

I cloned linux-2.6
Then I cloned netdev-2.6 with --reference $PWD/linux-2.6
Then I cloned net-2.6 with --reference $PWD/netdev-2.6

The problem:

git gc --prune on netdev-2.6 takes WAY more memory than git gc --prune
on linux-2.6
git gc --prune on net-2.6 takes WAY WAY more memory. 1.5G and counting.

Why does git gc --prune take 1.5G? (git pack-objects is the actual
memory-hungry process)

--
Jon

```

## Björn Steinbrink, 2009-02-12 18:59

Subject: Re: git gc --prune consumes *lots* of memory with repos cloned with --reference
Message-ID: <20090212185925.GC20552@atjola.homenet>
URL: https://gitlist.dev/e/20090212185925.GC20552%40atjola.homenet
In-Reply-To: <cccedfc60902121032y17180739r2a049197323d3588@mail.gmail.com>

```
On 2009.02.12 12:32:13 -0600, Jon Nelson wrote:
> The situation:
> 
> I cloned linux-2.6
> Then I cloned netdev-2.6 with --reference $PWD/linux-2.6
> Then I cloned net-2.6 with --reference $PWD/netdev-2.6
> 
> The problem:
> 
> git gc --prune on netdev-2.6 takes WAY more memory than git gc --prune
> on linux-2.6
> git gc --prune on net-2.6 takes WAY WAY more memory. 1.5G and counting.
> 
> Why does git gc --prune take 1.5G? (git pack-objects is the actual
> memory-hungry process)

Probably an older git version? There was a bug that caused a memory leak
with unreachable objects being forced to be loose objects. That was
fixed in 1.6.0.3

Björn

```

## Jon Nelson, 2009-02-12 20:37

Subject: Re: git gc --prune consumes *lots* of memory with repos cloned with --reference
Message-ID: <cccedfc60902121237h6bb9b9dn98c485e85c53440d@mail.gmail.com>
URL: https://gitlist.dev/e/cccedfc60902121237h6bb9b9dn98c485e85c53440d%40mail.gmail.com
In-Reply-To: <20090212185925.GC20552@atjola.homenet>

```
Indeed - I was running 1.6.0.2.

I tried 1.6.1.3 and it certainly helped the memory consumption
problem, although for some reason it went very slowly the first time.

Thanks!

On Thu, Feb 12, 2009 at 12:59 PM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
>
> Probably an older git version? There was a bug that caused a memory leak
> with unreachable objects being forced to be loose objects. That was
> fixed in 1.6.0.3


--
Jon

```
