Commit 33d62a12 authored by Jeremy Hylton's avatar Jeremy Hylton

Use fsindex for oid2curpos and oid2verpos.

Reduces memory usage during pack by a considerable fraction with
modest 10% slowdown.
parent d2c64994
......@@ -412,8 +412,8 @@ class GC(FileStorageFormatter):
self.packtime = packtime
# packpos: position of first txn header after pack time
self.packpos = None
self.oid2curpos = {} # maps oid to current data record position
self.oid2verpos = {} # maps oid to current version data
self.oid2curpos = fsIndex() # maps oid to current data record position
self.oid2verpos = fsIndex() # maps oid to current version data
# The set of reachable revisions of each object.
#
......@@ -445,6 +445,10 @@ class GC(FileStorageFormatter):
self.buildPackIndex()
self.findReachableAtPacktime([z64])
self.findReachableFromFuture()
# These mappings are no longer needed and may consume a lot
# of space.
del self.oid2verpos
del self.oid2curpos
def buildPackIndex(self):
pos = 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment