summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-18 21:33:30 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-18 21:33:30 +0000
commit44a52770d225d073fa00f537b4f5a401a1874323 (patch)
tree9213d753b43c07250a80bcd9ff785f7d2029ad65
parent97916d197e86afef0c8ec88329dace796384b3a3 (diff)
downloadportage-44a52770d225d073fa00f537b4f5a401a1874323.tar.gz
portage-44a52770d225d073fa00f537b4f5a401a1874323.tar.bz2
portage-44a52770d225d073fa00f537b4f5a401a1874323.zip
Bug #228075 - Explicitly call gc.collect() to try and free memory
when checking for blockers. This avoids a heap overflow that triggers 'Cannot allocate memory' errors (reported with python-2.5). svn path=/main/trunk/; revision=10717
-rw-r--r--pym/_emerge/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 0fa6befbe..fab9cece3 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -5825,6 +5825,12 @@ class MergeTask(object):
if self._opts_ignore_blockers.intersection(self.myopts):
return None
+ # Call gc.collect() here to avoid heap overflow that
+ # triggers 'Cannot allocate memory' errors (reported
+ # with python-2.5).
+ import gc
+ gc.collect()
+
blocker_dblinks = []
for blocking_pkg in self._blocker_db[
new_pkg.root].findInstalledBlockers(new_pkg,
@@ -5838,6 +5844,8 @@ class MergeTask(object):
self.pkgsettings[blocking_pkg.root], treetype="vartree",
vartree=self.trees[blocking_pkg.root]["vartree"]))
+ gc.collect()
+
return blocker_dblinks
def merge(self, mylist, favorites, mtimedb):