A simple IPython extension for monitoring memory usage of Jupyter notebook cells.
Project description
memprofiler
memprofiler is a simple extension for monitoring memory usage of Jupyter notebook cells.
Installation
It can be installed as a typical Python source package from PyPi using pip:
pip install memprofiler
Usage
A basic example of how to use this extension can be found in this interactive Jupyter notebook.
Reference
mprof_run
%mprof_run [-q] [-i INTERVAL] [-p] [profile_id]
Run memory profiler during cell execution. (cell_magic)
-
positional arguments:
- profile_id
Profile label. You can specify up to two keywords by separating them with :: (keyword0::keyword1
). Only profile_ids with two keywords can be used in plot-related functions.
- profile_id
-
optional arguments:
-
-q, --quiet
Suppress verbosity. -
-i INTERVAL, --interval INTERVAL
Sampling period (in seconds), default 0.01. -
-p, --plot
Plot the memory profile.
-
mprof_plot
%mprof_plot [-t TITLE] [--groupby {0,1}] profile_ids [profile_ids ...]
Plot detailed memory profiler results. (line_magic)
-
positional arguments:
- profile_ids
Profile identifiers made by mprof_run. Supports regex.
- profile_ids
-
optional arguments:
-
-t TITLE, --title TITLE
String shown as plot title. -
--groupby <{0,1}>
Identifier number used to group the results, default 1.
-
mprof_barplot
%mprof_barplot [-t TITLE] [--variable {time,memory}] [--barmode {group,stack}] [--groupby {0,1}] profile_ids [profile_ids ...]
Plot only-memory or only-time results in a bar chart. (line_magic)
-
positional arguments:
- profile_ids
Profile labels made by mprof_run. Supports regex.
- profile_ids
-
optional arguments:
-
-t TITLE, --title TITLE
String shown as plot title. -
--variable <{time,memory}>
Variable to plot, default 'memory'. -
--barmode <{group,stack}>
Bar char mode, default 'group'. -
--groupby <{0,1}>
Identifier number used to group the results, default 1.
-
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the BSD 3-Clause License. See LICENSE for more information.
Acknowledgements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file memprofiler-0.1.8.tar.gz
.
File metadata
- Download URL: memprofiler-0.1.8.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15fd7827eef0865c2c95642b64ef83d28026dbeaca499626f7ad27976669aab4 |
|
MD5 | 36edf0e83947e0fa70f9ba81ec524e99 |
|
BLAKE2b-256 | db2ec5bf2a608237e990ab2836e776c9c23048c5db5b9f60ff8f78a3391e2bbf |