@matheusbsbs / matheus-bagliano / commits / f7197dff15
Fork 0

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>

Eric Wong committed Oct 14, 2006 at 15:48 UTC f7197dff15a3ab12ce59626865c5a388a3bb0976
1 file changed +4 -2
git-svn.perl
+4 -2
@@ -3354,9 +3354,11 @@ sub chg_file {
3354 seek $fh, 0, 0 or croak $!;
3355
3356 my $exp = $md5->hexdigest;
3357 - my $atd = $self->apply_textdelta($fbat, undef, $self->{pool});
3358 - my $got = SVN::TxDelta::send_stream($fh, @$atd, $self->{pool});
3357 + my $pool = SVN::Pool->new;
3358 + my $atd = $self->apply_textdelta($fbat, undef, $pool);
3359 + my $got = SVN::TxDelta::send_stream($fh, @$atd, $pool);
3360 die "Checksum mismatch\nexpected: $exp\ngot: $got\n" if ($got ne $exp);
3361 + $pool->clear;
3362
3363 close $fh or croak $!;
3364 }