Commit 8838e4c4 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 1f7a377f
...@@ -412,8 +412,8 @@ class GC(FileStorageFormatter): ...@@ -412,8 +412,8 @@ class GC(FileStorageFormatter):
self.packtime = packtime self.packtime = packtime
# packpos: position of first txn header after pack time # packpos: position of first txn header after pack time
self.packpos = None self.packpos = None
self.oid2curpos = {} # maps oid to current data record position self.oid2curpos = fsIndex() # maps oid to current data record position
self.oid2verpos = {} # maps oid to current version data self.oid2verpos = fsIndex() # maps oid to current version data
# The set of reachable revisions of each object. # The set of reachable revisions of each object.
# #
...@@ -445,6 +445,10 @@ class GC(FileStorageFormatter): ...@@ -445,6 +445,10 @@ class GC(FileStorageFormatter):
self.buildPackIndex() self.buildPackIndex()
self.findReachableAtPacktime([z64]) self.findReachableAtPacktime([z64])
self.findReachableFromFuture() self.findReachableFromFuture()
# These mappings are no longer needed and may consume a lot
# of space.
del self.oid2verpos
del self.oid2curpos
def buildPackIndex(self): def buildPackIndex(self):
pos = 4 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