Mercurial > hg
changeset 23225:bdf7b1ea1dae stable
changegroup: don't store unused value on fnodes (issue4443)
The contents of fnodes are only accessed once per key. It is wasteful to
cache the value since nobody will use it.
Before this patch, the caching of unused data in fnodes was effectively
causing a memory leak during the file streaming part of bundle creation.
On mozilla-central (which has ~190,000 entries in fnodes), this patch
has a significant impact on RSS at the end of generate():
before: 516,124 KB
after: 364,356 KB
delta: -151,768 KB
The origin of this code can be traced back to 627cd7842e5d and has been
with us since the 2.7 release.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 06 Nov 2014 22:33:48 -0800 |
parents | f4ab47ccefde |
children | 5dcaed20b27c |
files | mercurial/changegroup.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/changegroup.py Thu Nov 06 20:57:12 2014 -0800 +++ b/mercurial/changegroup.py Thu Nov 06 22:33:48 2014 -0800 @@ -369,7 +369,7 @@ linkrev = llr(r) if linkrev in needed: yield filerevlog.node(r), cl.node(linkrev) - fnodes[fname] = dict(genfilenodes()) + return dict(genfilenodes()) return fnodes.get(fname, {}) for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,