git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <junkio@cox.net>, Sam Ravnborg <sam@ravnborg.org>,
	git@vger.kernel.org
Subject: Re: dumb transports not being welcomed..
Date: Wed, 14 Sep 2005 08:07:24 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0509140759030.26803@g5.osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.63.0509141014580.30708@wgmdd8.biozentrum.uni-wuerzburg.de>



On Wed, 14 Sep 2005, Johannes Schindelin wrote:
> 
> What I see when fetching all heads (thanks to Junio, this is one call to 
> git-fetch now), where all but origin are up to date, is that it takes a 
> very long time. Swapping kicks in, and top tells me that 26.6% of the 
> memory is occupied by git-rev-list (The server has 128M, with 1G swap, and 
> I am unfortunately not the only user of this machine).

Ok. As mentioned, I've not looked at memory usage. The machines I play 
with tend to have 2GB or more, simply because bk needed at least 1GB to be 
nice and cached on the kernel ;)

Git has needed less than bk, so I've not cared ;)

> I fail to see why it should need those amounts of memory. (I tested this 
> over the ssh protocol, which should essentially do the same as git-daemon, 
> right?) After all, the merge point between the branches should be marked 
> uninteresting after one single step from each of my private branches.

One of the issues is that git-rev-list will (for example) keep track of 
the commit messages too for every commit. That in itself can be a lot of 
stuff, depending on how active the tree is and how large the messages are.

Now, that should be easy enough to fix (parse_commit() normally saves the 
buffer it parses into "commit->buffer", so we'd just need to do something 
like

	if (!verbose_header && commit->buffer) {
		free(commit->buffer);
		commit->buffer = NULL;
	}

for each commit.

But for --objects, the bigger memory pressure is that it needs to track 
the "struct object" for every single object when it generates the 
reference tracking. And THAT tends to be expensive. The object lists are 
also not very space-efficient (ie one small allocation for each list 
entry).

We could probably make objects/lists more space-efficient.

> I also see other strange things like packing 0 objects, and packing >0 
> objects after just having fetched from that repository. Hopefully I will 
> have time to look into that (and understand the code to begin with).

Well, the "packing 0 objects" should be normal. I'm surprised at the ">0" 
case after a fetch: the packign is _not_ guaranteed to be exact, but if 
you have the exact same state as (or a superset of) the other end, you 
should always see a zero.

		Linus

  reply	other threads:[~2005-09-14 15:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 21:07 dumb transports not being welcomed Junio C Hamano
2005-09-13 21:14 ` Sam Ravnborg
2005-09-13 21:30   ` Junio C Hamano
2005-09-13 21:42     ` Sam Ravnborg
2005-09-13 22:03     ` Horst von Brand
2005-09-13 22:23       ` Junio C Hamano
2005-09-13 22:11     ` Junio C Hamano
2005-09-13 22:21       ` Jeff Garzik
2005-09-13 22:29         ` Junio C Hamano
2005-09-14 13:21           ` Jeff Garzik
2005-09-13 22:29       ` Linus Torvalds
2005-09-13 22:37         ` Junio C Hamano
2005-09-13 22:55           ` Linus Torvalds
2005-09-13 23:02             ` Junio C Hamano
2005-09-14  2:25               ` Kay Sievers
2005-09-14  3:32                 ` Junio C Hamano
2005-09-14  0:01         ` Johannes Schindelin
2005-09-14  0:57           ` Linus Torvalds
2005-09-14  1:42             ` Linus Torvalds
2005-09-14  8:38             ` Johannes Schindelin
2005-09-14 15:07               ` Linus Torvalds [this message]
2005-09-15  9:17         ` Junio C Hamano
2005-09-14 10:45       ` Sven Verdoolaege
2005-09-14 16:14         ` Junio C Hamano
2005-09-14 14:10       ` Jon Loeliger
2005-09-14 19:00         ` Junio C Hamano
2005-09-14 19:13           ` Jon Loeliger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0509140759030.26803@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).