# 需要導入模塊: import tracemalloc [as 別名]# 或者: from tracemalloc importget_traced_memory[as 別名]deftest_get_traced_memory(self):# Python allocates some internals objects, so the test must tolerate# a small difference between the expected size and the real usagemax_error =2048# allocate ...
deftest_get_traced_memory(self):# Python allocates some internals objects, so the test must tolerate# a small difference between the expected size and the real usagemax_error =2048# allocate one objectobj_size =1024*1024tracemalloc.clear_traces() obj, obj_traceback = allocate_bytes(obj_size...
tracemalloc.get_traced_memory () 获取tracemalloc模块作为元组跟踪的内存块的当前大小和峰值大小 :。 (current: int, peak: int) tracemalloc.get_tracemalloc_memory () 获取tracemalloc用于存储内存块的跟踪的模块的内存使用情况 (以字节为单位 )。返回 int。 23 /3/library/tracemalloc.html 5/11 2017/3/12 ...
get_traced_memory()¶ Get the current size and peak size of memory blocks traced by the tracemalloc module as a tuple: (current: int, peak: int). tracemalloc.get_tracemalloc_memory()¶ Get the memory usage in bytes of the tracemalloc module used to store traces of memory blocks. ...
self.assertEqual(tracemalloc.get_traced_memory(), (0,0)) 开发者ID:asvetlov,项目名称:cpython,代码行数:35,代码来源:test_tracemalloc.py 示例2: test_task_memory_threshold deftest_task_memory_threshold(self):diff =Nonedeflog_func():nonlocaldiff ...