Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a value for pack.windowMemory?

Tags:

git

I am trying to limit the amount of memory that git gc --aggressive is using. I set pack.windowMemory to 8 GB to do that:

git config --global pack.windowMemory 8g

The config file now correctly shows:

[pack]
    windowMemory = 8g

The documentation shows that this should work.

But git gc produces an error:

$ git gc --aggressive

fatal: bad numeric config value '8g' for 'pack.windowmemory': out of range

fatal: failed to run repack

How can I set pack.windowMemory?

like image 536
boot4life Avatar asked May 24 '26 21:05

boot4life


1 Answers

pack.windowmemory is a ulong.

maximum_unsigned_value_of_type(long) is 232 (32-bit) = 4,294,967,296 ≈ 4 billion.

g suffix is 1,073,741,824. 8 × 1,073,741,824 = 8,589,934,592 ≈ 8 billion.

You need to choose a value at most around 4 GB.

like image 179
grg Avatar answered May 27 '26 13:05

grg