예제 #1
0
	def __exit__(self, type, value, traceback):
		"Quit the app and perform garbage collection"
		if self._app is not None:
			self._app.Quit()
			self._app = None
		GC.Collect()
		GC.WaitForPendingFinalizers()
		GC.Collect()
		GC.WaitForPendingFinalizers()
예제 #2
0
    def tearDown(self):
        import clr
        from System import GC

        for i in range(3):
            GC.Collect()
            GC.WaitForPendingFinalizers()

        if os.path.isfile(self.filename):
            os.unlink(self.filename)
예제 #3
0
def gcwait():
    """
    Attempt to force a garbage collection, and wait for pending finalizers.
    
    If you think you need to call this function, you're probably wrong.
    """
    for _ in range(4):
        _mapper.DemandCleanup()
        GC.Collect()
        GC.WaitForPendingFinalizers()
예제 #4
0
 def get_memory():
     for _ in range(4):
         GC.Collect()
         GC.WaitForPendingFinalizers()
     return GC.GetTotalMemory(True) / 1e6
예제 #5
0
파일: gc.py 프로젝트: nathanwblair/ironclad
def gcwait():
    GC.Collect()
    GC.WaitForPendingFinalizers()