aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-11-03 06:13:08 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-11-03 06:13:08 (GMT)
commit7df2be1716f4faeba5138287e1596d2395c777bb (patch)
treef97ca6f272c4273c0af0dc38cdf5ce94396e3cee
parent3c4a553a245d736622a5ae584e6ddbb0e73b15ff (diff)
downloadfusearchive-7df2be1716f4faeba5138287e1596d2395c777bb.zip
fusearchive-7df2be1716f4faeba5138287e1596d2395c777bb.tar.gz
fusearchive-7df2be1716f4faeba5138287e1596d2395c777bb.tar.bz2
Added note about mem leak with a bandaid fix
-rw-r--r--FuseArchive/ChunkFile.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/FuseArchive/ChunkFile.py b/FuseArchive/ChunkFile.py
index 99f7d32..c33ae73 100644
--- a/FuseArchive/ChunkFile.py
+++ b/FuseArchive/ChunkFile.py
@@ -363,23 +363,14 @@ class ChunkFile(object):
logging.debug( "Pre-Buf: %s" % hexlify(buf) )
logging.debug( "Pre-Chunk: %s" % hexlify(self.chunk) )
- # Check if we are appending only, appends are much faster than
- # splicing up string
+ # Check if we are appending only
if self.chunk.length() == rest and len( buf ) <= this_len:
logging.debug( "Doing quick append" )
self.chunk.append( buf )
else:
- logging.debug( "SLOOOOW! Doing string splice" )
- # Since python doesn't do in-place reassignment like you
- # can with splice() we will reconstruct the data by joining
- # stuff by offsets (first chars to skip, then our joining
- # buf chunk, the everything that would have been after it)
-
- # This sucks for moving around data, it is very slow!
self.chunk.replace( buf[ buf_offset:(buf_offset+this_len) ],
rest, rest + this_len )
-
if FuseArchive.deep_debug:
logging.debug( "Post-Buf: %s" % hexlify(buf) )
logging.debug( "Post-Chunk: %s" % hexlify(self.chunk) )
@@ -414,6 +405,13 @@ class ChunkFile(object):
self.flush()
self.file.close()
+ # There is some kind of mem leak, ChunkFile objects end up in a
+ # tuple of [obj,True] for every object written and never get freed,
+ # maybe a fuse bug?
+ del self.chunks
+ del self.chunk
+ del self.original_chunks
+
def _fflush(self):
if self.wr and self.modified:
logging.debug( "_fflush!" )