aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-03-04 22:02:42 -0800
committerZac Medico <zmedico@gentoo.org>2016-03-05 00:16:19 -0800
commita0f48531213976c20190e61dea7100b190f5139f (patch)
tree8312d81882281b57f64b7ec717a60569225fd87f
parentruntests: support pypy3 (many failures with pypy3-2.4.0-r1) (diff)
downloadportage-a0f48531213976c20190e61dea7100b190f5139f.tar.gz
portage-a0f48531213976c20190e61dea7100b190f5139f.tar.bz2
portage-a0f48531213976c20190e61dea7100b190f5139f.zip
portdbapi.aux_get: don't cache in memory unless frozen
Fix the portdbapi aux_get method to cache metadata in memory only when the "frozen" flag has been set, so that applications do not consume more memory than necessary. This change does not affect depgraph performance, since depgraph caches the metadata separately (in Package instances). X-Gentoo-Bug: 576488 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576488 Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/portage/dbapi/porttree.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 23f3169b7..1f4374e95 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -550,7 +550,7 @@ class portdbapi(dbapi):
#finally, we look at our internal cache entry and return the requested data.
returnme = [mydata.get(x, "") for x in mylist]
- if cache_me:
+ if cache_me and self.frozen:
aux_cache = {}
for x in self._aux_cache_keys:
aux_cache[x] = mydata.get(x, "")
@@ -817,6 +817,7 @@ class portdbapi(dbapi):
def melt(self):
self.xcache = {}
+ self._aux_cache = {}
self.frozen = 0
def xmatch(self,level,origdep,mydep=None,mykey=None,mylist=None):