[pypy-commit] pypy libgccjit-backend: Fix a MemoryError issue seen running test_int_operations

dmalcolm noreply at buildbot.pypy.org
Tue Dec 23 18:56:50 CET 2014


Author: David Malcolm <dmalcolm at redhat.com>
Branch: libgccjit-backend
Changeset: r75088:70555a2aeb22
Date: 2014-12-23 12:37 -0500
http://bitbucket.org/pypy/pypy/changeset/70555a2aeb22/

Log:	Fix a MemoryError issue seen running test_int_operations

	test_int_operations was failing after compiling about 200 loops with
	a MemoryError, unable to fulfil an allocation of 129GB of RAM.

	Fix it by cleaning up the datablockwrapper after each compile.

diff --git a/rpython/jit/backend/libgccjit/assembler.py b/rpython/jit/backend/libgccjit/assembler.py
--- a/rpython/jit/backend/libgccjit/assembler.py
+++ b/rpython/jit/backend/libgccjit/assembler.py
@@ -261,6 +261,9 @@
         clt.frame_info.update_frame_depth(baseofs,
                                           max_args)
 
+        self.datablockwrapper.done()      # finish using cpu.asmmemmgr
+        self.datablockwrapper = None
+
         self.ctxt.dump_to_file("/tmp/%s.c" % loopname, r_int(1))
 
         #raise foo
@@ -296,6 +299,10 @@
         self.num_bridges += 1
 
         self.make_function(name, inputargs, operations)
+
+        self.datablockwrapper.done()      # finish using cpu.asmmemmgr
+        self.datablockwrapper = None
+
         self.ctxt.dump_to_file("/tmp/%s.c" % name, r_int(1))
         jit_result = self.ctxt.compile()
         self.ctxt.release()


More information about the pypy-commit mailing list