{"id":6594,"date":"2014-04-20T13:43:34","date_gmt":"2014-04-20T13:43:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/git-fails-to-push-with-error-out-of-memory-collection-of-common-programming-errors\/"},"modified":"2014-04-20T13:43:34","modified_gmt":"2014-04-20T13:43:34","slug":"git-fails-to-push-with-error-out-of-memory-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/git-fails-to-push-with-error-out-of-memory-collection-of-common-programming-errors\/","title":{"rendered":"Git fails to push with error &#39;out of memory&#39;-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m using gitosis on a server that has a low amount of memory, specifically around 512 MB. When I try to push a large folder (happens to be a backup from an android phone), I get:<\/p>\n<pre><code>me@corellia:~\/Configs\/$ git push origin master\n\nCounting objects: 18, done.\nDelta compression using up to 8 threads.\nCompressing objects: 100% (14\/14), done.\nfatal: Out of memory, malloc failed MiB | 685 KiB\/s   \nerror: pack-objects died of signal 13\nerror: failed to push some refs to 'git@dagobah:Configs'\n<\/code><\/pre>\n<p>I&#8217;ve been searching the web, and notably found: http:\/\/www.mail-archive.com\/git-users@googlegroups.com\/msg01747.html as well as http:\/\/git.661346.n2.nabble.com\/Out-of-memory-error-during-git-push-td5443705.html but these don&#8217;t seem to help me for two reasons: 1) I am not actually out of memory when I push. When I run &#8216;top&#8217; during the push, I get:<\/p>\n<pre><code>24262 git       18   0 16204 6084 1096 S    2  1.2   0:00.12 git-unpack-obje   \n<\/code><\/pre>\n<p>Also, during the push if I run \/head\/meminfo, I get:<\/p>\n<pre><code>MemTotal:       524288 kB\nMemFree:        289408 kB\nBuffers:             0 kB\nCached:              0 kB\nSwapCached:          0 kB\nActive:              0 kB\nInactive:            0 kB\nHighTotal:           0 kB\nHighFree:            0 kB\nLowTotal:       524288 kB\n<\/code><\/pre>\n<p>So, it seems that I have enough memory free, but it&#8217;s actually still failing, and I&#8217;m not enough of a git guru to figure out what is happening. I would appreciate it if someone could give me a hand here and tell me what could be causing this problem, and what I can do to solve it.<\/p>\n<p>Thanks!<\/p>\n<p><strong>EDIT:<\/strong><\/p>\n<p>The output of running the <code>ulimit -a<\/code> command:<\/p>\n<pre><code>scottj@dagobah:~$ ulimit -a\ncore file size          (blocks, -c) 0\ndata seg size           (kbytes, -d) unlimited\nscheduling priority             (-e) 0\nfile size               (blocks, -f) unlimited\npending signals                 (-i) 204800\nmax locked memory       (kbytes, -l) 32\nmax memory size         (kbytes, -m) unlimited\nopen files                      (-n) 1024\npipe size            (512 bytes, -p) 8\nPOSIX message queues     (bytes, -q) 819200\nreal-time priority              (-r) 0\nstack size              (kbytes, -s) 10240\ncpu time               (seconds, -t) unlimited\nmax user processes              (-u) 204800\nvirtual memory          (kbytes, -v) unlimited\nfile locks                      (-x) unlimited\n<\/code><\/pre>\n<p><strong>EDIT<\/strong>:<\/p>\n<p>The git objects and sizes are:<\/p>\n<pre><code>313796  .git\/objects\/88\/7ce48679f885af4c466d4ddccef9a9954a9de6\n224276  .git\/objects\/18\/261f6a52926a756c7ecb453e025d1f25937026\n6248    .git\/objects\/63\/a0b4e622c893d3dcc162052b43301030d0c86d\n5608    .git\/objects\/a2\/0c65987656cba591171549752eb97f0207fec8\n2608    .git\/objects\/pack\/pack-3be8300f69b67fa8fa687df84bbd9b8c96e86c8e.pack\n28  .git\/objects\/pack\/pack-3be8300f69b67fa8fa687df84bbd9b8c96e86c8e.idx\n24  .git\/objects\/c9\/8909563ec60369d69ac2d317af25a44c9fc198\n24  .git\/objects\/5d\/1f74bd9bc4c575a7eeec08d59916d9829068d1\n24  .git\/objects\/53\/edad79cb051f5e7864d9d3339fa59990ccfe2d\n8   .git\/objects\/80\/dd50c7a314950e5a1f56c0210b0a91f48ee792\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using gitosis on a server that has a low amount of memory, specifically around 512 MB. When I try to push a large folder (happens to be a backup from an android phone), I get: me@corellia:~\/Configs\/$ git push origin master Counting objects: 18, done. Delta compression using up to 8 threads. Compressing objects: 100% [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6594","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6594"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6594\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}