warp.print_memory_report#
- warp.print_memory_report(file=None, sort='size', max_items=10)[source]#
Print a report of all currently tracked memory allocations.
Requires
warp.config.track_memoryto beTrue(set beforewarp.init()), or an activeScopedMemoryTracker.Note
Not safe to call concurrently from multiple threads.
- Parameters:
file – File object to write to (defaults to
sys.stdout).sort – Sort order for live allocations:
"size"(default, largest first) or"chronological"(oldest first).max_items – Maximum number of individual allocations shown per category (default
10).
- Raises:
ValueError – If
sortis not"size"or"chronological".RuntimeError – If allocation tracking is not active.