Skip to content

Commit

Permalink
Use svn pools to solve the memory leak problem.
Browse files Browse the repository at this point in the history
Signed-off-by: Yaacov Akiba Slama <ya@slamail.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Yaacov Akiba Slama authored and Junio C Hamano committed Nov 8, 2005
1 parent 4bfb6b6 commit fcfa32b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-svnimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ sub file {
DIR => File::Spec->tmpdir(), UNLINK => 1);

print "... $rev $path ...\n" if $opt_v;
eval { $self->{'svn'}->get_file($path,$rev,$fh); };
my $pool = SVN::Pool->new();
eval { $self->{'svn'}->get_file($path,$rev,$fh,$pool); };
$pool->clear;
if($@) {
return undef if $@ =~ /Attempted to get checksum/;
die $@;
Expand Down Expand Up @@ -674,7 +676,9 @@ sub commit_all {
}

while(++$current_rev <= $svn->{'maxrev'}) {
$svn->{'svn'}->get_log("/",$current_rev,$current_rev,$current_rev,1,1,\&_commit_all,"");
my $pool=SVN::Pool->new;
$svn->{'svn'}->get_log("/",$current_rev,$current_rev,1,1,1,\&_commit_all,$pool);
$pool->clear;
commit_all();
if($opt_l and not --$opt_l) {
print STDERR "Stopping, because there is a memory leak (in the SVN library).\n";
Expand Down

0 comments on commit fcfa32b

Please sign in to comment.