From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <junkio@cox.net>,
Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: git@vger.kernel.org
Subject: [PATCH] git-svn: reduce memory usage for large commits
Date: Sat, 14 Oct 2006 15:48:35 -0700 [thread overview]
Message-ID: <20061014224834.GB12565@soma> (raw)
In-Reply-To: <20061014224636.GA12565@soma>
apply_textdelta and send_stream can use a separate pool from the
rest of the editor interface, so we'll use a separate SVN::Pool
for them and clear the pool after each file is sent to SVN.
This drastically reduces memory usage per-changeset committed,
and makes large commits (and initial imports) of several
thousand files possible.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-svn.perl | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 0f968c8..54d2356 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3354,9 +3354,11 @@ sub chg_file {
seek $fh, 0, 0 or croak $!;
my $exp = $md5->hexdigest;
- my $atd = $self->apply_textdelta($fbat, undef, $self->{pool});
- my $got = SVN::TxDelta::send_stream($fh, @$atd, $self->{pool});
+ my $pool = SVN::Pool->new;
+ my $atd = $self->apply_textdelta($fbat, undef, $pool);
+ my $got = SVN::TxDelta::send_stream($fh, @$atd, $pool);
die "Checksum mismatch\nexpected: $exp\ngot: $got\n" if ($got ne $exp);
+ $pool->clear;
close $fh or croak $!;
}
--
1.4.3.rc2.ge931
next prev parent reply other threads:[~2006-10-14 22:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 19:19 git-svn and u-boot broken Joakim Tjernlund
2006-10-13 19:39 ` Randal L. Schwartz
2006-10-13 19:43 ` Joakim Tjernlund
2006-10-14 1:21 ` Joakim Tjernlund
2006-10-14 6:28 ` Eric Wong
2006-10-14 9:51 ` Joakim Tjernlund
2006-10-14 22:46 ` Eric Wong
2006-10-14 22:48 ` Eric Wong [this message]
2006-10-14 23:54 ` Joakim Tjernlund
-- strict thread matches above, loose matches on Subject: below --
2006-10-14 13:13 Joakim Tjernlund
2006-10-14 21:09 ` Eric Wong
2006-10-15 0:39 ` Joakim Tjernlund
2006-10-15 1:48 ` Eric Wong
2006-10-15 2:10 ` Joakim Tjernlund
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061014224834.GB12565@soma \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=joakim.tjernlund@transmode.se \
--cc=junkio@cox.net \
/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.
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 NNTP newsgroup(s).