detkit.Memory.now#

Memory.now()#

Inquiry current memory allocation.

Returns:
current_memfloat

The net memory allocation and deallocation since calling detkit.Memory.set() divided by the specified unit of memory.

See also

set
peak

Examples

>>> from detkit import Memory, memdet
>>> import numpy

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

>>> # Initialize with KB unit
>>> mem = Memory(unit='KB')

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

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

>>> # Inquiry current allocated memory in KB unit
>>> print(mem.now())
781489.4