Sharedmemory-profile.ipynbOpen in CoCalc
Author: Harald Schilly
Views : 26

Memory Profiler

Kernel: Python 3 Ubuntu Linux

In [1]:
%load_ext memory_profiler
In [2]:
import numpy as np def func(N): x = np.random.randn(N) y = 2 * x + 1 return y
In [3]:
%memit func(123)
peak memory: 78.85 MiB, increment: 0.18 MiB
In [4]:
%memit func(987654)
peak memory: 92.54 MiB, increment: 13.66 MiB
In [ ]: