detkit.Profile.mem_now#

Profile.mem_now()#

Inquiry current net memory allocation since profiling is set.

Returns:
current_memfloat

The net memory allocation and deallocation since calling detkit.Profile.set().

See also

set
mem_peak

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 current memory allocation
>>> print(human_readable_mem(prof.mem_now()))
79.4 KB