2017-03-06 25 views
2

失败的混帐拉错误,我跑混帐拉在我的Ubuntu虚拟机,然后我得到了致命的:内存不足,malloc的在Ubuntu VM

Enter passphrase for key '/root/.ssh/id_rsa': 
remote: Counting objects: 7, done. 
remote: Compressing objects: 100% (7/7), done. 
remote: Total 7 (delta 4), reused 0 (delta 0) 
Unpacking objects: 100% (7/7), done. 
From bitbucket.org:bheng/app 
    7406b4e..8f5e3dc master  -> origin/master 
Auto packing the repository for optimum performance. You may also 
run "git gc" manually. See "git help gc" for more information. 
Counting objects: 5384, done. 
fatal: Out of memory, malloc failed (tried to allocate 306851376 bytes) 
error: failed to run repack 
Updating 7406b4e..8f5e3dc 
Fast-forward 
Auto packing the repository for optimum performance. You may also 
run "git gc" manually. See "git help gc" for more information. 
Counting objects: 5384, done. 
fatal: Out of memory, malloc failed (tried to allocate 306851376 bytes) 
error: failed to run repack 
resources/views/layouts/fe/meta.blade.php | 14 +++++++++++++- 
1 file changed, 13 insertions(+), 1 deletion(-) 

正如你可以在最后看到的 - 它拉我的本地变化很好。

但我只是想摆脱这些错误...我怎么摆脱他们?清除我的缓存?


只见git gc是推荐的命令清除本地文件,但我甚至无法运行。

Counting objects: 7709, done. 
fatal: Out of memory, malloc failed (tried to allocate 306851376 bytes) 
error: failed to run repack 

我也试过

的git fsck的

Checking object directories: 100% (256/256), done. 
Checking objects: 100% (2377/2377), done. 
dangling commit 32c8482dcc118bd64c1f8e45ee093c286a840e5d 
dangling commit abce13f3bfb8c3833c7b76f4aea9cd28caa3af03 
dangling blob c9131033c721c0b90c86bf7b32377588354363ec 
dangling commit de6d83d883d35f97cb211233e2283c9d79e6f922 
dangling blob d535c98d611cca74af45633c77680bb2bdc5e55a 

最后,运行git pull一次得到这个

Auto packing the repository for optimum performance. You may also 
run "git gc" manually. See "git help gc" for more information. 
Counting objects: 5384, done. 
fatal: Out of memory, malloc failed (tried to allocate 306851376 bytes) 
error: failed to run repack 
Already up-to-date. 

任何提示/建议将不胜感激!

回答

3

那么,你的系统只是内存不足。如果需要,Git会定期运行git gc,这是错误消息的来源,因为您也可以在手动运行时看到它。它试图重新包装你的Git仓库,并且在尝试分配293 MiB额外的RAM时失败。将更多的RAM放入您的盒子中,或者至少放大交换大小,即使只是暂时使重新打包成功完成。如果您只是暂时将此设置为帮助重新打包完成,则可以在系统运行时轻松添加一些交换文件。文档可以在https://help.ubuntu.com/community/SwapFaq#Four-step_Process_to_Add_Swap_File上找到,如果只是临时性的而不做最后一步。

+0

git是否使用虚拟机系统内存? – ihue

+0

我已经有1 GB。 '#dmidecode 2.12 SMBIOS 2.4存在。 手柄为0x1000,DMI 16型,15个字节 物理存储器阵列 \t地区:其他 \t用途:系统内存 \t纠错类型:多位ECC \t最大容量:1 GB \t错误信息手柄:不提供 \t设备数量:1' – ihue

+0

'php.ini'中的memory_limit设置意味着什么? – ihue

0

尝试以下这些指令:https://stackoverflow.com/a/8761464/1278288

git config --global pack.windowMemory "100m" git config --global pack.packSizeLimit "100m" git config --global pack.threads "1"

应该减少所需的内存。

尽管至少有1GB的交换是个好主意。

相关问题