git push fails - Out of memory, malloc failed
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
After executing a git push
the following output is displayed:
1
2
3
4
5
6
7
Counting objects: 84347, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (44724/44724), done.
Writing objects: 100% (84347/84347), 4.83 GiB | 1.68 MiB/s, done.
Total 84347 (delta 36315), reused 84347 (delta 36315)
fatal: Out of memory, malloc failed (tried to allocate 1797195454 bytes)
error: unpack failed: index-pack abnormal exit
Cause
This usually happens when the Bitbucket Server instance doesn't have available memory to fork out Git processes.
Resolution
To dimension your Bitbucket Server instance correctly in terms of memory, please refer to Scaling Bitbucket Data Center where you can find more details on how Bitbucket Server forks out Git processes and how expensive it is.
Add memory to your Bitbucket Server instance accordingly.
Was this helpful?