From 0a9316a59e2994599f0782e3b840eda529fb696d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 19 Jun 2008 04:09:06 +0000 Subject: [PATCH] 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). (trunk r10717) svn path=/main/branches/2.1.2/; revision=10722 --- bin/emerge | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/emerge b/bin/emerge index 18a4b5c39..822df6bc4 100755 --- a/bin/emerge +++ b/bin/emerge @@ -5917,6 +5917,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, @@ -5930,6 +5936,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): -- 2.26.2