{"thread":{"id":"3736","subject":"[PATCH] Reintroduce svn pools to solve the memory leak.","startedAt":"2006-03-27T11:26:01Z","lastAt":"2006-03-28T12:20:31Z","messageCount":4,"participants":["Santi Béjar","Junio C Hamano","Jan-Benedict Glaw","Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18031","messageId":"8aa486160603270326i3a8ddcfau61ca84cdac036ff9@mail.gmail.com","threadId":"3736","inReplyTo":null,"subject":"[PATCH] Reintroduce svn pools to solve the memory leak.","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-03-27T11:26:01Z","receivedAt":"2006-03-27T11:26:01Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 3/24/06, Santi Béjar <sbejar@gmail.com> wrote:\n> Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:\n>\n> > On Wed, 2006-03-22 14:33:37 +0100, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:\n> >\n> > Since it seems nobody looked at the GCC import run (which means to use\n> > the svnimport), I ran it again, under strace control:\n> >\n> >> GCC\n> >> ~~~\n> >> $ /home/jbglaw/bin/git svnimport -C gcc -v svn://gcc.gnu.org/svn/gcc\n> >\n> >> Committed change 3936:/ 1993-03-31 05:44:03)\n> >> Commit ID ceff85145f8671fb2a9d826a761cedc2a507bd1e\n> >> Writing to refs/heads/origin\n> >> DONE: 3936 origin ceff85145f8671fb2a9d826a761cedc2a507bd1e\n> >> ... 3937 trunk/gcc/final.c ...\n> >> Can't fork at /home/jbglaw/bin/git-svnimport line 379.\n> >\n>\n> I have the same (?) problem with one of my svn repository. It worked\n> before (I've redone the import with the -r flag), so I bisected it.\n> The problematic commit seems to be:\n>\n> diff-tree 4802426... (from 525c0d7...)\n> Author: Karl  Hasselström <kha@treskal.com>\n> Date:   Sun Feb 26 06:11:27 2006 +0100\n>\n>     svnimport: Convert executable flag\n>\n>     Convert the svn:executable property to file mode 755 when converting\n>     an SVN repository to GIT.\n>\n>     Signed-off-by: Karl Hasselström <kha@treskal.com>\n>     Signed-off-by: Junio C Hamano <junkio@cox.net>\n>\n> :100755 100755 ee2940f... 6603b96... M  git-svnimport.perl\n>\n> I think it has a memory leak, it used up to 140m of memory.\n>\n> $ git reset --hard 4802426^\n> $ time ../git-svnimport.perl file:///path/\n> Use of uninitialized value in string eq at ../git-svnimport.perl line 463.\n> Use of uninitialized value in substitution (s///) at ../git-svnimport.perl line 466.\n> real    0m55.801s\n> user    0m30.578s\n> sys     0m23.084s\n>\n> $ git reset --hard 4802426\n> $ time ../git-svnimport.perl file:///path/\n> Use of uninitialized value in string eq at ../git-svnimport.perl line 463.\n> Use of uninitialized value in substitution (s///) at ../git-svnimport.perl line 466.\n> Can't fork at /home/santi/usr/src/scm/git/git-svnimport.perl line 331.\n> real    6m2.163s\n> user    0m20.332s\n> sys     0m50.180s\n>\n> and it didn't finished. Hope it helps.\n\nAnd this patch fixes my problems.\n\n---\n\nIntroduced in 4802426.\n\nSigned-off-by: Santi Béjar <sbejar@gmail.com>\n---\n git-svnimport.perl |    4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 639aa41..f2cf062 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -135,8 +135,10 @@\n\n        print \"... $rev $path ...\\n\" if $opt_v;\n        my (undef, $properties);\n+       my $pool = SVN::Pool->new();\n        eval { (undef, $properties)\n-                  = $self->{'svn'}->get_file($path,$rev,$fh); };\n+                  = $self->{'svn'}->get_file($path,$rev,$fh,$pool); };\n+       $pool->clear;\n        if($@) {\n                return undef if $@ =~ /Attempted to get checksum/;\n                die $@;\n"},{"id":"18037","messageId":"7vhd5joiqt.fsf@assigned-by-dhcp.cox.net","threadId":"3736","inReplyTo":"8aa486160603270326i3a8ddcfau61ca84cdac036ff9@mail.gmail.com","subject":"Re: [PATCH] Reintroduce svn pools to solve the memory leak.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-27T18:16:58Z","receivedAt":"2006-03-27T18:16:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Santi Béjar\" <sbejar@gmail.com> writes:\n\n> On 3/24/06, Santi Béjar <sbejar@gmail.com> wrote:\n>> Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:\n>>\n>> diff-tree 4802426... (from 525c0d7...)\n>> Author: Karl  Hasselström <kha@treskal.com>\n>> Date:   Sun Feb 26 06:11:27 2006 +0100\n>>\n>>     svnimport: Convert executable flag\n>>\n>>     Convert the svn:executable property to file mode 755 when converting\n>>     an SVN repository to GIT.\n>>\n>>     Signed-off-by: Karl Hasselström <kha@treskal.com>\n>>     Signed-off-by: Junio C Hamano <junkio@cox.net>\n>>\n>> :100755 100755 ee2940f... 6603b96... M  git-svnimport.perl\n>\n> And this patch fixes my problems.\n\nJan-Benedict, thanks for pinpointing the regression, and Santi,\nthanks for the patch.\n\nI should have looked a bit more closely when applying the patch\n-- it is clear that the patch is doing more than what its log\nsays.  My fault.\n\nKarl, were there other reasons you needed to disable the pool\nhere (maybe to work around a problem with incompatible version\nof SVN module)?  I see some other uses of SVN::Pool still there\nin the code, so I am assuming this was a simple typo, but just\nin case...\n"},{"id":"18065","messageId":"20060328081037.GH31387@lug-owl.de","threadId":"3736","inReplyTo":"7vhd5joiqt.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Reintroduce svn pools to solve the memory leak.","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2006-03-28T08:10:37Z","receivedAt":"2006-03-28T08:10:37Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"On Mon, 2006-03-27 10:16:58 -0800, Junio C Hamano <junkio@cox.net> wrote:\n> \"Santi Béjar\" <sbejar@gmail.com> writes:\n> > On 3/24/06, Santi Béjar <sbejar@gmail.com> wrote:\n> >> Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:\n> >>\n> >> diff-tree 4802426... (from 525c0d7...)\n> >> Author: Karl  Hasselström <kha@treskal.com>\n> >> Date:   Sun Feb 26 06:11:27 2006 +0100\n> >>\n> >>     svnimport: Convert executable flag\n> >>\n> >>     Convert the svn:executable property to file mode 755 when converting\n> >>     an SVN repository to GIT.\n> >>\n> >>     Signed-off-by: Karl Hasselström <kha@treskal.com>\n> >>     Signed-off-by: Junio C Hamano <junkio@cox.net>\n> >>\n> >> :100755 100755 ee2940f... 6603b96... M  git-svnimport.perl\n> >\n> > And this patch fixes my problems.\n> \n> Jan-Benedict, thanks for pinpointing the regression, and Santi,\n> thanks for the patch.\n\nI'm currently running another test with GCC: this patch cuts down\nmemory consumption to less than 1/10 of the previous state (VSZ) and\neven more for RSS (my system is quite loaded...)\n\nMfG, JBG\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n für einen Freien Staat voll Freier Bürger\"  | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"},{"id":"18070","messageId":"20060328122031.GA14124@diana.vm.bytemark.co.uk","threadId":"3736","inReplyTo":"7vhd5joiqt.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Reintroduce svn pools to solve the memory leak.","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-03-28T12:20:31Z","receivedAt":"2006-03-28T12:20:31Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-03-27 10:16:58 -0800, Junio C Hamano wrote:\n\n> Karl, were there other reasons you needed to disable the pool here\n> (maybe to work around a problem with incompatible version of SVN\n> module)? I see some other uses of SVN::Pool still there in the code,\n> so I am assuming this was a simple typo, but just in case...\n\nNo, it's just a simple mistake (the mistake being me not realizing why\nan explicit pool was needed, and simply dropping it when things worked\nfine without it).\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}