{"thread":{"id":"12893","subject":"git clone out of memory. alternatives?","startedAt":"2008-03-28T02:29:47Z","lastAt":"2008-03-28T11:55:47Z","messageCount":3,"participants":["Jeffrey Chang","Linus Torvalds","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73234","messageId":"beb5fde90803271929u40a98915ifd05234476ab92f9@mail.gmail.com","threadId":"12893","inReplyTo":null,"subject":"git clone out of memory. alternatives?","fromName":"Jeffrey Chang","fromEmail":"jeffrey.chang@duke.edu","sentAt":"2008-03-28T02:29:47Z","receivedAt":"2008-03-28T02:29:47Z","isPatch":false,"sender":{"key":"jeffrey.chang@duke.edu","avatar":null},"body":"Hello,\n\nI am working with a large-ish git repository set up as a shared\nrepository.  I am the only user of this repository, and I access it\nover ssh.\n\nI am running into a problem where I can no longer clone the repository\non a new computer.  I get a message that seems to indicate that the\nmachine with the repository is running out of memory.\n\nxigua:~/remotecvs jchang$ git clone [...]\nInitialized empty Git repository in [...]\nremote: Generating pack...\nremote: Done counting 9122 objects.\nremote: Deltifying 9122 objects...\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: fatal: out of memoryremote:\nremote: aborting due to possible repository corruption on the remote side.\nfatal: early EOF\nfatal: index-pack failed\nfetch-pack from [...] failed.\nxigua:~/remotecvs jchang$\n\nMoving the repository to another machine is not an option, nor is\nadding more RAM to that machine.\n\nIs there any way to get around this problem?  For example:\n- Can I run git clone in a way that uses less memory, such as cloning\na piece of the repository at a time?\n- Can I export the entire repository as a file that can be loaded on\nmy target machine, like \"svnadmin dump\" for subversion?\n- Can I just rsync the repository from another computer that already has a copy?\n- Are there any other work-arounds to set up a copy of the repository\non my local machine?\n\nThanks,\nJeff\n"},{"id":"73235","messageId":"alpine.LFD.1.00.0803272001120.14670@woody.linux-foundation.org","threadId":"12893","inReplyTo":"beb5fde90803271929u40a98915ifd05234476ab92f9@mail.gmail.com","subject":"Re: git clone out of memory. alternatives?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-03-28T03:04:18Z","receivedAt":"2008-03-28T03:04:18Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 27 Mar 2008, Jeffrey Chang wrote:\n> \n> Is there any way to get around this problem?  For example:\n> - Can I run git clone in a way that uses less memory, such as cloning\n> a piece of the repository at a time?\n\nCloning really is pretty memory-intensive, because it involves going \nthrough every single object.\n\nWhat you *can* do is to limit cloning to the rsync protocol, which is \nstrictly quite horrible (none of the inherent sanity-checks of the native \nprotocol), but it avoids the server-side costs.\n\nHowever, you'll eventually hit other problems, like the fact that you also \nwon't be able to do a full repack on the server side (because a full \nrepack does the same thing).\n\n> - Can I export the entire repository as a file that can be loaded on\n> my target machine, like \"svnadmin dump\" for subversion?\n\nThat's essentially what a repack does. See above about the problem.\n\n> - Can I just rsync the repository from another computer that already has a copy?\n\nYes. You can. And you can also repack on another host and then rsync the \nresults back to the server. It's not pretty, but it should work.\n\n\t\tLinus\n"},{"id":"73249","messageId":"alpine.LSU.1.00.0803281250230.3802@racer.site","threadId":"12893","inReplyTo":"beb5fde90803271929u40a98915ifd05234476ab92f9@mail.gmail.com","subject":"Re: git clone out of memory. alternatives?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-28T11:55:47Z","receivedAt":"2008-03-28T11:55:47Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 27 Mar 2008, Jeffrey Chang wrote:\n\n> I am working with a large-ish git repository set up as a shared \n> repository.  I am the only user of this repository, and I access it over \n> ssh.\n> \n> I am running into a problem where I can no longer clone the repository \n> on a new computer.  I get a message that seems to indicate that the \n> machine with the repository is running out of memory.\n\nAFAICT the config variables pack.* (see config.txt) allow to tune the \npacking, even for cloning.\n\nHth,\nDscho\n"}]}