From: Yaacov Akiba Slama Date: Wed, 2 Nov 2005 21:51:57 +0000 (+0200) Subject: Use svn pools to solve the memory leak problem. X-Git-Tag: v0.99.9g^2~2^2~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=fcfa32b9e10b3c0373a263a732146850bdf67242;p=git.git Use svn pools to solve the memory leak problem. Signed-off-by: Yaacov Akiba Slama Signed-off-by: Junio C Hamano --- diff --git a/git-svnimport.perl b/git-svnimport.perl index 45b6a198..5bf9ef21 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -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 $@; @@ -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";