# What the best git repack option to avoid out of memory (2G free memory)

2 messages from 2011-04-17 to 2011-04-17. Participants: Ping Yin.
Thread: https://gitlist.dev/t/27121

## Ping Yin, 2011-04-17 03:24

Subject: What the best git repack option to avoid out of memory (2G free memory)
Message-ID: <BANLkTimOnuSsSeuZ5QvLQLZBg1QnnDzaNw@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTimOnuSsSeuZ5QvLQLZBg1QnnDzaNw%40mail.gmail.com

```
When "gc --auto --aggressive --prune" android platform/prebuilt.git, i
encountered the following error:

Auto packing the repository for optimum performance.
warning: suboptimal pack - out of memory
fatal: Out of memory, malloc failed
error: failed to run repack

I have 2G free memory available and found the --window and
--window-memory option in git repack. However, i wonder how to compute
the max memory git-repack will use, is it "window * window-memory"?

And what is the best --window and --window-memory option for the 2G
free available memory?

```

## Ping Yin, 2011-04-17 03:32

Subject: Re: What the best git repack option to avoid out of memory (2G free memory)
Message-ID: <BANLkTi=ABGrsUCxpB6fUXCP0477iq=irhw@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTi%3DABGrsUCxpB6fUXCP0477iq%3Dirhw%40mail.gmail.com
In-Reply-To: <BANLkTimOnuSsSeuZ5QvLQLZBg1QnnDzaNw@mail.gmail.com>

```
On Sun, Apr 17, 2011 at 11:24 AM, Ping Yin <pkufranky@gmail.com> wrote:
> When "gc --auto --aggressive --prune" android platform/prebuilt.git, i
> encountered the following error:
>
> Auto packing the repository for optimum performance.
> warning: suboptimal pack - out of memory
> fatal: Out of memory, malloc failed
> error: failed to run repack
>
> I have 2G free memory available and found the --window and
> --window-memory option in git repack. However, i wonder how to compute
> the max memory git-repack will use, is it "window * window-memory"?
>

Or "window * windowMemory * threads"?

```
