# HG changeset patch # User Matt Mackall # Date 2010-08-05 21:17:17 # Node ID 6ccd130eab0e9e425e8459754619ad75dffcdf56 # Parent eb7b04657dae79f4b6b707022e3633faa97824da revlog: drop cache after use to save memory footprint If we reconstruct back to back large versions, we need to drop the cache first to avoid doubling memory usage. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1029,6 +1029,9 @@ class revlog(object): base = self._cache[1] text = self._cache[2] + # drop cache to save memory + self._cache = None + self._loadindex(base, rev + 1) self._chunkraw(base, rev) if text is None: