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

Ilia Mirkin imirkin at alum.mit.edu
Wed Jan 22 09:12:13 PST 2014


On Wed, Jan 22, 2014 at 10:46 AM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> 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>

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

> ---
>  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
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list