On Wed, Jan 22, 2014 at 10:46 AM, Dylan Baker <[email protected]> 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 <[email protected]>

Reviewed-by: Ilia Mirkin <[email protected]>

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

Reply via email to