Skip to content

Commit

Permalink
git-svn: reduce memory usage for large commits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Oct 15, 2006
1 parent 6844fc8 commit f7197df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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 $!;
}
Expand Down

0 comments on commit f7197df

Please sign in to comment.