From: Zac Medico Date: Wed, 18 Jun 2008 21:33:30 +0000 (-0000) Subject: Bug #228075 - Explicitly call gc.collect() to try and free memory X-Git-Tag: v2.2_rc1~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=44a52770d225d073fa00f537b4f5a401a1874323;p=portage.git 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 --- 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):