CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Avatar for Testing 18.04.

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

| Download
Project: Testing 18.04
Views: 463
Kernel: Python 3 (Ubuntu Linux)

Memory Profiler

Kernel: Python 3 Ubuntu Linux

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