[Speed] Tracking memory usage

Victor Stinner victor.stinner at gmail.com
Fri Jul 29 12:58:19 EDT 2016


I modified my perf module to add two new options: --tracemalloc and
--track-memory.

--tracemalloc enables tracemalloc and gets the peak of the traced
Python memory allocations: peak is computed per process.

--track-memory is similar but reads PeakPagefileUsage of
GetProcessMemoryInfo() on Windows or private data from /proc/self/smap
on Linux. The read is done every millisecond (1 ms) in a thread, in
the worker process.

It's not perfect, but it should be "as good" as the "old" CPython
benchmark suite. And it makes the benchmark suite simpler because
tracking memory usage is now done automatically by the perf module.

Victor


More information about the Speed mailing list