detkit.Profile.mem_peak#

Profile.mem_peak()#

Inquiry peak memory allocation since profiling is set.

Returns:
peak_memfloat

The peak memory allocation since calling detkit.Profile.set().

See also

set
mem_now

Examples

>>> from detkit import Profile, memdet, human_readable_mem
>>> import numpy

>>> # Create a random matrix
>>> A = numpy.random.randn(10000, 10000)

>>> # Initialize profile
>>> prof = Profile()

>>> # Set the starting point of memory inquiry
>>> prof.set()

>>> # Perform a memory-intensive operation
>>> ld = memdet(A)

>>> # Inquiry the peak memory allocation
>>> print(human_readable_mem(prof.mem_peak()))
763.2 MB