Using Python's 3.5 tracemalloc module as follows
tracemalloc.start(25) # (I also tried PYTHONTRACEMALLOC=25)
snapshot_start = tracemalloc.take_snapshot()
... # my code is running
snapshot_stop = tracemalloc.take_snapshot()
diff = snapshot_stop.compare_to(snapshot_start, 'lineno')
tracemalloc.stop()
leads in a list of StatisticDiff instances where each instance has a traceback with only 1 (the most recent) frame.
Any hints how to get there the full stack trace for each StatisticDiff instance?
Thank you! Michael