aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-10-14 15:48:35 -0700
committerJunio C Hamano <junkio@cox.net>2006-10-14 17:38:52 -0700
commitf7197dff15a3ab12ce59626865c5a388a3bb0976 (patch)
treed709363d28f4c724cc5a623ed5a0af9b4116224d
parent6844fc806ace7d7c31ad788a8886cfd0498ceec5 (diff)
downloadgit-f7197dff15a3ab12ce59626865c5a388a3bb0976.tar.gz
git-f7197dff15a3ab12ce59626865c5a388a3bb0976.tar.xz
git-svn: reduce memory usage for large commits
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> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-svn.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 0f968c8ce..54d235693 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 $!;
}