{"thread":{"id":"21616","subject":"git gc - out of memory","startedAt":"2009-11-14T19:26:00Z","lastAt":"2009-11-16T23:10:09Z","messageCount":4,"participants":["Simon Strandgaard","Alejandro Riveira"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127554","messageId":"df1390cc0911141126w1a0c5691p83885053a73f829@mail.gmail.com","threadId":"21616","inReplyTo":null,"subject":"git gc - out of memory","fromName":"Simon Strandgaard","fromEmail":"neoneye@gmail.com","sentAt":"2009-11-14T19:26:00Z","receivedAt":"2009-11-14T19:26:00Z","isPatch":false,"sender":{"key":"neoneye@gmail.com","avatar":"https://gravatar.com/avatar/27e9d5599fd07b2705ef9c5fc11968319dbe137d1574764fc1ab77bdeda36870?d=mp&s=160"},"body":"My bare repository is on an OpenBSD machine.\nI was unaware of the importance of git gc until today\nafter investigating a problem with \"git pull\".\nSo there hasn't been run git gc on the repository ever.\n\nThe biggest file in the repository is a 45 mb file.\nThe repository size is near 2 gb.\n\nWhat can I do?\n\n$ git gc\nCounting objects: 5934, done.\nwarning: suboptimal pack - out of memory\nfatal: Out of memory, malloc failed8)\nerror: failed to run repack\n$ git --version\ngit version 1.6.5.2\n$ uname -a\nOpenBSD amiga.opcoders.com 4.3 GENERIC#698 i386\n$ ulimit -a\ntime(cpu-seconds)    unlimited\nfile(blocks)         unlimited\ncoredump(blocks)     unlimited\ndata(kbytes)         524288\nstack(kbytes)        4096\nlockedmem(kbytes)    662576\nmemory(kbytes)       1985524\nnofiles(descriptors) 128\nprocesses            64\n$ du -ks myrepository.git\n1859538 myrepository.git\n$\n\n\n\nBelow is the \"git pull\" problem I'm having. I think its caused\nby the former problem. When pulling it dies because of malloc failure.\n\nprompt> git pull\nremote: Counting objects: 280, done.\nremote: fatal: Out of memory, malloc failed\nerror: git upload-pack: git-pack-objects died with error.\nfatal: git upload-pack: aborting due to possible repository corruption\non the remote side.\nremote: aborting due to possible repository corruption on the remote side.\nfatal: protocol error: bad pack header\nprompt> git --version\ngit version 1.6.5.2\nprompt> uname -a\nDarwin pidgin.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15\n16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 i386\nprompt> sw_vers\nProductName:    Mac OS X\nProductVersion: 10.5.8\nBuildVersion:   9L31a\nprompt>\n\n\nKind regards\nSimon Strandgaard - http://gdtoolbox.com/\n"},{"id":"127616","messageId":"hdp44d$4ml$1@ger.gmane.org","threadId":"21616","inReplyTo":"df1390cc0911141126w1a0c5691p83885053a73f829@mail.gmail.com","subject":"Re: git gc - out of memory","fromName":"Alejandro Riveira","fromEmail":"ariveira@gmail.com","sentAt":"2009-11-15T14:44:29Z","receivedAt":"2009-11-15T14:44:29Z","isPatch":false,"sender":{"key":"ariveira@gmail.com","avatar":null},"body":"El Sat, 14 Nov 2009 20:26:00 +0100, Simon Strandgaard escribió:\n\n> My bare repository is on an OpenBSD machine. I was unaware of the\n> importance of git gc until today after investigating a problem with \"git\n> pull\". So there hasn't been run git gc on the repository ever.\n> \n> The biggest file in the repository is a 45 mb file. The repository size\n> is near 2 gb.\n> \n> What can I do?\n\nrun « git repack -adf --window=memory » on the repo where memory is\nescaled apropiately for your machine ?\n\nSee « git help repack »\n\nRegards;\n"},{"id":"127623","messageId":"df1390cc0911151033h2825053fxafe5bb2bb788fbb2@mail.gmail.com","threadId":"21616","inReplyTo":"hdp44d$4ml$1@ger.gmane.org","subject":"Re: git gc - out of memory","fromName":"Simon Strandgaard","fromEmail":"neoneye@gmail.com","sentAt":"2009-11-15T18:33:27Z","receivedAt":"2009-11-15T18:33:27Z","isPatch":false,"sender":{"key":"neoneye@gmail.com","avatar":"https://gravatar.com/avatar/27e9d5599fd07b2705ef9c5fc11968319dbe137d1574764fc1ab77bdeda36870?d=mp&s=160"},"body":"On Sun, Nov 15, 2009 at 3:44 PM, Alejandro Riveira <ariveira@gmail.com> wrote:\n> El Sat, 14 Nov 2009 20:26:00 +0100, Simon Strandgaard escribió:\n[snip]\n>> What can I do?\n>\n> run « git repack -adf --window=memory » on the repo where memory is\n> escaled apropiately for your machine ?\n\nThank you Alejandro, it now works!\n\nI think the default is 10, so I tried with window=5 and\nit completed a full repack.\n\n$ git repack -adf --window=5\nCounting objects: 5934, done.\nCompressing objects: 100% (5711/5711), done.\nWriting objects: 100% (5934/5934), done.\nTotal 5934 (delta 3733), reused 0 (delta 0)\nRemoving duplicate objects: 100% (256/256), done.\n$ git gc\nCounting objects: 5934, done.\nCompressing objects: 100% (1978/1978), done.\nWriting objects: 100% (5934/5934), done.\nTotal 5934 (delta 3733), reused 5934 (delta 3733)\n$\n\n\nNow that it works..\nShould I report the original issue as a bug somewhere?\ne.g. malloc failed sounds like a bug.\n\n\n\nKind regards\nSimon Strandgaard - http://gdtoolbox.com/\n"},{"id":"127708","messageId":"hdsm4h$s2v$1@ger.gmane.org","threadId":"21616","inReplyTo":"df1390cc0911151033h2825053fxafe5bb2bb788fbb2@mail.gmail.com","subject":"Re: git gc - out of memory","fromName":"Alejandro Riveira","fromEmail":"ariveira@gmail.com","sentAt":"2009-11-16T23:10:09Z","receivedAt":"2009-11-16T23:10:09Z","isPatch":false,"sender":{"key":"ariveira@gmail.com","avatar":null},"body":"El Sun, 15 Nov 2009 19:33:27 +0100, Simon Strandgaard escribió:\n\n\n>>\n>> run « git repack -adf --window=memory » on the repo where memory is\n>> escaled apropiately for your machine ?\n> \n> Thank you Alejandro, it now works!\n\n ell glad it does becouse i mad a typo ...\n\n> \n> I think the default is 10, so I tried with window=5 and it completed a\n> full repack.\n\n I was trying to make you use --window-memory=[memory] not --window= ;P\n\n> \n\n> \n> Now that it works..\n> Should I report the original issue as a bug somewhere? e.g. malloc\n> failed sounds like a bug.\n\n This is the right place. Just wait for someone more knowledgeable than\nme ...\n\n> \n> \n> \n> Kind regards\n> Simon Strandgaard - http://gdtoolbox.com/\n"}]}