[Piglit] [PATCH 2/2] framework/summary.py: fix memory consumption issue

Dylan Baker baker.dylan.c at gmail.com
Wed Jan 22 07:46:56 PST 2014


running piglit-summary.py on any decent sized results would result in
the total consumption of all memory, followed by the total consumption
of all swap (totalling 16GB), followed by oom killing on my system.
Replacing the list generating dict.values() with the dict.itervalues()
iterators keeps memory consumption under 1%.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/summary.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/summary.py b/framework/summary.py
index 2ba5f16..94ee0dc 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -340,7 +340,7 @@ class Summary:
         self.totals = {'pass': 0, 'fail': 0, 'crash': 0, 'skip': 0, 'warn': 0,
                        'dmesg-warn': 0, 'dmesg-fail': 0}
 
-        for test in self.results[-1].tests.values():
+        for test in self.results[-1].tests.itervalues():
             self.totals[str(test['result'])] += 1
 
     def generate_html(self, destination, exclude):
@@ -481,4 +481,4 @@ class Summary:
             print "      fixes: %d" % len(self.tests['fixes'])
             print "regressions: %d" % len(self.tests['regressions'])
 
-        print "      total: %d" % sum(self.totals.values())
+        print "      total: %d" % sum(self.totals.itervalues())
-- 
1.8.5.3



More information about the Piglit mailing list