From 3d91f19f8afb8e2fa59518abd709ff677148f00c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 4 Nov 2008 07:55:01 +0000 Subject: [PATCH] Free some memory by clearing the LinkageMap cache when it's not needed. svn path=/main/trunk/; revision=11807 --- pym/_emerge/__init__.py | 1 + pym/portage/__init__.py | 1 + pym/portage/dbapi/vartree.py | 1 + 3 files changed, 3 insertions(+) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index f65fda5dc..773c01d34 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -13464,6 +13464,7 @@ def clear_caches(trees): d["porttree"].dbapi._aux_cache.clear() d["bintree"].dbapi._aux_cache.clear() d["bintree"].dbapi._clear_cache() + d["vartree"].dbapi.linkmap._clear_cache() portage.dircache.clear() gc.collect() diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index b269ea9e9..002bb4d6e 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -6091,6 +6091,7 @@ def unmerge(cat, pkg, myroot, mysettings, mytrimworld=1, vartree=None, return retval return os.EX_OK finally: + self.vartree.dbapi.linkmap._clear_cache() mylink.unlockdb() def getCPFromCPV(mycpv): diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index f88431ee0..418d87388 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -3767,6 +3767,7 @@ class dblink(object): self._scheduler.dblinkEbuildPhase( self, mydbapi, myebuild, "clean") finally: + self.vartree.dbapi.linkmap._clear_cache() self.unlockdb() return retval -- 2.26.2