[Networkit] measuring memory usage with IPython and the memory_profiler
meyerhenke at kit.edu
Sat Nov 15 14:07:18 CET 2014
I assume the measurements are reasonably correct and refer to what's
actually being done in C++, right?
Am 15.11.14 um 09:53 schrieb Christian Staudt:
> Hi all,
> I’ve recently discovered an easy way to measure peak memory usage for
> NetworKit code.
> First install the Python modules psutil and memory_profiler, e.g. with
> >>> pip install psutil
> >>> pip install memory_profiler
> From an IPython shell, use the %memit command to show peak memory usage
> of the Python process and incremental memory usage of the piece of code
> being profiled. In this case, reading the graph took 2.59 MB additional
> memory and running Betweenness took 6.99 MB more.
> In [*1*]: %load_ext memory_profiler
> In [*2*]: from networkit import *
> In [*3*]: %memit G =
> peak memory: 79.37 MiB, increment: 2.59 MiB
> In [*5*]: %memit centrality.Betweenness(G).run()
> peak memory: 87.26 MiB, increment: 6.99 MiB
Karlsruhe Institute of Technology (KIT)
Institute of Theoretical Informatics (ITI)
Juniorprof. Dr. Henning Meyerhenke
Theoret. Informatics / Parallel Computing
KIT - University of the State of Baden-Wuerttemberg and
National Research Center of the Helmholtz Association
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5316 bytes
Desc: S/MIME Cryptographic Signature
More information about the NetworKit