git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-svn: reduce memory usage for large commits

From
EWEric Wong <normalperson@yhbt.net>
Date
Oct 14, 2006, 22:48 UTC
Message-ID
<20061014224834.GB12565@soma>
In-Reply-To
<20061014224636.GA12565@soma>

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>
---
 git-svn.perl |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 0f968c8..54d2356 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -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 $!;
 }
-- 
1.4.3.rc2.ge931
Previous: Eric WongNext: Joakim Tjernlund
Message 8 of 9 in “git-svn and u-boot broken.”
  1. Joakim TjernlundOct 13, 2006
  2. Randal L. SchwartzOct 13, 2006
  3. Joakim TjernlundOct 13, 2006
  4. Joakim TjernlundOct 14, 2006
  5. Eric WongOct 14, 2006
  6. Joakim TjernlundOct 14, 2006
  7. Eric WongOct 14, 2006
  8. git-svn: reduce memory usage for large commitsEric Wong, Oct 14, 2006
  9. Joakim TjernlundOct 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.