Lines Matching refs:tracemalloc
4 import tracemalloc
34 nframe = tracemalloc.get_traceback_limit()
38 return data, tracemalloc.Traceback(frames)
57 snapshot = tracemalloc.Snapshot(raw_traces, traceback_limit)
69 snapshot2 = tracemalloc.Snapshot(raw_traces2, traceback_limit)
74 return tracemalloc._Frame((filename, lineno))
77 return tracemalloc.Traceback(frames)
88 if tracemalloc.is_tracing():
91 tracemalloc.start(1)
94 tracemalloc.stop()
98 size = tracemalloc.get_tracemalloc_memory()
101 tracemalloc.clear_traces()
102 size2 = tracemalloc.get_tracemalloc_memory()
107 tracemalloc.clear_traces()
110 traceback = tracemalloc.get_object_traceback(obj)
116 tracemalloc.stop()
117 self.assertRaises(ValueError, tracemalloc.start, -1)
119 tracemalloc.stop()
120 tracemalloc.start(10)
122 traceback = tracemalloc.get_object_traceback(obj2)
126 tracemalloc.stop()
127 tracemalloc.start(1)
129 traceback = tracemalloc.get_object_traceback(obj)
141 tracemalloc.clear_traces()
145 traces = tracemalloc._get_traces()
153 tracemalloc.stop()
154 self.assertEqual(tracemalloc._get_traces(), [])
166 tracemalloc.stop()
167 tracemalloc.start(4)
172 traces = tracemalloc._get_traces()
190 tracemalloc.clear_traces()
192 size, peak_size = tracemalloc.get_traced_memory()
201 size2, peak_size2 = tracemalloc.get_traced_memory()
207 tracemalloc.clear_traces()
208 self.assertEqual(tracemalloc.get_traced_memory(), (0, 0))
212 size, peak_size = tracemalloc.get_traced_memory()
216 tracemalloc.stop()
217 self.assertEqual(tracemalloc.get_traced_memory(), (0, 0))
221 traceback = tracemalloc.get_object_traceback(obj)
224 tracemalloc.clear_traces()
225 traceback2 = tracemalloc.get_object_traceback(obj)
229 tracemalloc.stop()
230 self.assertFalse(tracemalloc.is_tracing())
232 tracemalloc.start()
233 self.assertTrue(tracemalloc.is_tracing())
239 snapshot = tracemalloc.take_snapshot()
246 snapshot2 = tracemalloc.Snapshot.load(support.TESTFN)
250 tracemalloc.stop()
252 tracemalloc.take_snapshot()
259 snapshot = tracemalloc.take_snapshot()
265 snapshot2 = tracemalloc.Snapshot.load(support.TESTFN)
269 if not tracemalloc.is_tracing():
274 traceback = tracemalloc.get_object_traceback(obj)
306 stack.enter_context(patch.object(tracemalloc, 'is_tracing',
308 stack.enter_context(patch.object(tracemalloc, 'get_traceback_limit',
310 stack.enter_context(patch.object(tracemalloc, '_get_traces',
313 snapshot = tracemalloc.take_snapshot()
324 filter1 = tracemalloc.Filter(False, "b.py")
325 filter2 = tracemalloc.Filter(True, "a.py", 2)
326 filter3 = tracemalloc.Filter(True, "a.py", 5)
362 filter1 = tracemalloc.Filter(False, "a.py", domain=1)
363 filter2 = tracemalloc.Filter(True, "a.py", domain=1)
389 filter1 = tracemalloc.DomainFilter(False, domain=3)
390 filter2 = tracemalloc.DomainFilter(True, domain=3)
419 tracemalloc.Statistic(tb_b_1, 66, 1),
420 tracemalloc.Statistic(tb_a_2, 30, 3),
421 tracemalloc.Statistic(tb_0, 7, 1),
422 tracemalloc.Statistic(tb_a_5, 2, 1),
428 tracemalloc.Statistic(tb_a_5, 5002, 2),
429 tracemalloc.Statistic(tb_c_578, 400, 1),
430 tracemalloc.Statistic(tb_a_2, 30, 3),
436 tracemalloc.StatisticDiff(tb_a_5, 5002, 5000, 2, 1),
437 tracemalloc.StatisticDiff(tb_c_578, 400, 400, 1, 1),
438 tracemalloc.StatisticDiff(tb_b_1, 0, -66, 0, -1),
439 tracemalloc.StatisticDiff(tb_0, 0, -7, 0, -1),
440 tracemalloc.StatisticDiff(tb_a_2, 30, 0, 3, 0),
453 tracemalloc.Statistic(tb_b, 66, 1),
454 tracemalloc.Statistic(tb_a, 32, 4),
455 tracemalloc.Statistic(tb_0, 7, 1),
461 tracemalloc.Statistic(tb_a, 5032, 5),
462 tracemalloc.Statistic(tb_c, 400, 1),
468 tracemalloc.StatisticDiff(tb_a, 5032, 5000, 5, 1),
469 tracemalloc.StatisticDiff(tb_c, 400, 400, 1, 1),
470 tracemalloc.StatisticDiff(tb_b, 0, -66, 0, -1),
471 tracemalloc.StatisticDiff(tb_0, 0, -7, 0, -1),
484 tracemalloc.Statistic(tb3, 66, 1),
485 tracemalloc.Statistic(tb1, 30, 3),
486 tracemalloc.Statistic(tb4, 7, 1),
487 tracemalloc.Statistic(tb2, 2, 1),
494 tracemalloc.Statistic(tb2, 5002, 2),
495 tracemalloc.Statistic(tb5, 400, 1),
496 tracemalloc.Statistic(tb1, 30, 3),
502 tracemalloc.StatisticDiff(tb2, 5002, 5000, 2, 1),
503 tracemalloc.StatisticDiff(tb5, 400, 400, 1, 1),
504 tracemalloc.StatisticDiff(tb3, 0, -66, 0, -1),
505 tracemalloc.StatisticDiff(tb4, 0, -7, 0, -1),
506 tracemalloc.StatisticDiff(tb1, 30, 0, 3, 0),
525 tracemalloc.Statistic(tb_b, 98, 5),
526 tracemalloc.Statistic(tb_a, 32, 4),
527 tracemalloc.Statistic(tb_0, 7, 1),
533 tracemalloc.Statistic(tb_b_1, 66, 1),
534 tracemalloc.Statistic(tb_b_4, 32, 4),
535 tracemalloc.Statistic(tb_a_2, 30, 3),
536 tracemalloc.Statistic(tb_0, 7, 1),
537 tracemalloc.Statistic(tb_a_5, 2, 1),
613 f = tracemalloc.Filter(True, "abc")
620 f = tracemalloc.Filter(False, "test.py", 123, True)
627 … f = tracemalloc.Filter(inclusive=False, filename_pattern="test.py", lineno=123, all_frames=True)
638 f = tracemalloc.Filter(True, "abc")
646 f = tracemalloc.Filter(False, "abc")
655 f = tracemalloc.Filter(True, "abc", 5)
663 f = tracemalloc.Filter(False, "abc", 5)
672 f = tracemalloc.Filter(True, "abc", 0)
680 f = tracemalloc.Filter(False, "abc", 0)
690 f = tracemalloc.Filter(inclusive, pattern)
703 filter = tracemalloc.Filter(True, pattern)
776 f = tracemalloc.Filter(True, "b.py", all_frames=True)
782 f = tracemalloc.Filter(True, "b.py", all_frames=False)
788 f = tracemalloc.Filter(False, "b.py", all_frames=True)
794 f = tracemalloc.Filter(False, "b.py", all_frames=False)
800 f = tracemalloc.Filter(False, "<unknown>", all_frames=False)
806 f = tracemalloc.Filter(True, "<unknown>", all_frames=True)
812 f = tracemalloc.Filter(False, "<unknown>", all_frames=True)
909 if tracemalloc.is_tracing():
921 tracemalloc.stop()
926 return tracemalloc.Traceback(frames)
941 snapshot = tracemalloc.take_snapshot()
942 domain_filter = tracemalloc.DomainFilter(True, self.domain)
948 tracemalloc.start(nframe)
950 size = tracemalloc.get_traced_memory()[0]
954 tracemalloc.Traceback(frames))
968 tracemalloc.start(nframe)
977 tracemalloc.Traceback(frames))
980 tracemalloc.start()
996 tracemalloc.start()
997 tracemalloc.stop()
1004 tracemalloc.start()
1007 tracemalloc.stop()