Skip to content

Commit

Permalink
git-svn: avoid a huge memory spike with high-numbered revisions
Browse files Browse the repository at this point in the history
Passing very large strings as arguments is bad for memory usage
as it never seems to get freed in Perl.  The .rev_db format is
already not optimized for projects with sparse history.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Eric Wong committed Feb 23, 2007
1 parent d4eff2b commit 47a0b75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,9 @@ sub rev_db_set {
seek $fh, 0, 2 or croak $!;
my $pos = tell $fh;
if ($pos < $offset) {
print $fh (('0' x 40),"\n") x (($offset - $pos) / 41)
or croak $!;
for (1 .. (($offset - $pos) / 41)) {
print $fh (('0' x 40),"\n") or croak $!;
}
}
seek $fh, $offset, 0 or croak $!;
print $fh $commit,"\n" or croak $!;
Expand Down

0 comments on commit 47a0b75

Please sign in to comment.