improver.memprofile module
Module containing maximum memory profiling utilities.
-
memory_monitor(queue, outfile_prefix)[source]
Function to track memory usage, should be run in a separate
thread to the main program.
Samples max_rss every 0.1s, if the max_rss is higher than the
previous max_rss, then creates a tracemalloc snapshot. There is a
performance overhead when using this.
- Parameters:
-
- Return type:
None
-
memory_profile_decorator(func, outfile_prefix)[source]
A decorator for convenience of running.
- Parameters:
-
- Return type:
Callable
- Returns:
The wrapper
-
memory_profile_end(queue, thread)[source]
Ends the memory tracking profiler.
- Parameters:
-
- Return type:
None
-
memory_profile_start(outfile_prefix)[source]
Starts the memory tracking profiler.
- Parameters:
outfile_prefix (str) – Prefix for the generated output. 2 files will
be generated: *_SNAPSHOT and *_MAX_TRACKER.
- Return type:
Tuple[Thread, Queue]
- Returns:
-