Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 11754:6ccd130eab0e stable
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.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 05 Aug 2010 16:17:17 -0500 |
parents | a463e3c50212 |
children | 05deba16c5d5 |
comparison
equal
deleted
inserted
replaced
11753:eb7b04657dae | 11754:6ccd130eab0e |
---|---|
1027 # do we have useful data cached? | 1027 # do we have useful data cached? |
1028 if self._cache and self._cache[1] >= base and self._cache[1] < rev: | 1028 if self._cache and self._cache[1] >= base and self._cache[1] < rev: |
1029 base = self._cache[1] | 1029 base = self._cache[1] |
1030 text = self._cache[2] | 1030 text = self._cache[2] |
1031 | 1031 |
1032 # drop cache to save memory | |
1033 self._cache = None | |
1034 | |
1032 self._loadindex(base, rev + 1) | 1035 self._loadindex(base, rev + 1) |
1033 self._chunkraw(base, rev) | 1036 self._chunkraw(base, rev) |
1034 if text is None: | 1037 if text is None: |
1035 text = self._chunk(base) | 1038 text = self._chunk(base) |
1036 | 1039 |