At http://bzr.arbash-meinel.com/branches/bzr/1.8-dev/sftp_chunked
------------------------------------------------------------
revno: 3693
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: sftp_chunked
timestamp: Wed 2008-09-10 12:21:34 -0500
message:
Purge the list buffer when we have a simple string buffer.
=== modified file 'bzrlib/transport/sftp.py'
--- a/bzrlib/transport/sftp.py 2008-09-04 03:03:27 +0000
+++ b/bzrlib/transport/sftp.py 2008-09-10 17:21:34 +0000
@@ -246,6 +246,9 @@
# when there is only one string ''.join([x]) == x, so there is
# no data copying.
buffered = ''.join(buffered_data)
+ # Clean out buffered data so that we keep memory
+ # consumption low
+ del buffered_data[:]
buffered_offset = 0
# TODO: We *could* also consider the case where cur_offset is
in
# in the buffered range, even though it doesn't *start*
@@ -276,6 +279,7 @@
buffered_len = len(buffered)
if buffered_len:
buffered = ''.join(buffered_data)
+ del buffered_data[:]
data_chunks.append((input_start, buffered))
if data_chunks:
mutter('SFTP readv left with %d out-of-order bytes',
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits