Skip to contentSkip to conversation

tests/gem_fenced_exec_thrash.c: Fix memory leaks

PATCH In review Derek Morton 2 participants 2 messages Jun 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/gem_fenced_exec_thrash.c: Fix memory leaks

gem_fenced_exec_thrash was not freeing any resources between subtests. On 1Gb android systems this resulted in the test failing with an OOM error.

Added cleanup code to free BOs at the end of each subtest.

---
 tests/gem_fenced_exec_thrash.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
tests/gem_fenced_exec_thrash.c +12 -0
index 75f251c..c0e820f 100644
@@ -215,6 +215,18 @@ static void run_test(int fd, int num_fences, int expected_errno,
 
 	if (flags & INTERRUPTIBLE)
 		igt_stop_signal_helper();
+
+	/* Cleanup */
+	for (n = 0; n < 2*num_fences; n++)
+		gem_close(fd, exec[0][n].handle);
+
+	for (i = 0; i < 2; i++)
+		gem_close(fd, exec[i][2*num_fences].handle);
+
+	if (flags & BUSY_LOAD) {
+		intel_batchbuffer_free(batch);
+		drm_intel_bufmgr_destroy(bufmgr);
+	}
 }
 
 int fd;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 7 lines · Derek Morton

gem_fenced_exec_thrash was not freeing any resources between subtests. On 1Gb android systems this resulted in the test failing with an OOM error.

Added cleanup code to free BOs at the end of each subtest.

Thanks, pushed

commit c69b13578399915f71f4ccc10cae188c31381c6a

Author: Derek Morton <[email protected]>
Date:   Fri Jun 26 11:36:00 2015 +0100

igt/gem_fenced_exec_thrash: Fix memory leak between tests
-Chris

Quoted 1 line
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx