Out Of Mana Memory
Provides a function that keeps an eye on your RAM and stops executing of the process if you are running out of memory.
Installation
To install oom enter this in your terminal.
pip install oom
Usage
Example 1: The simplest
from oom import exit_on_out_of_ram
one_gigabyte = 1 << 30
exit_on_out_of_ram(one_gigabyte)
# explode your RAM
extremely_big_number = 1 << 9999999
_ = [i for i in range(extremely_big_number)]
Example 2: Full
from oom import exit_on_out_of_ram
one_gigabyte = 1 << 30
exit_on_out_of_ram(
terminate_on=one_gigabyte,
warn_on = 2 * one_gigabyte,
sleep_time=1,
notify_about_using=True
)
# explode your RAM
extremely_big_number = 1 << 9999999
_ = [i for i in range(extremely_big_number)]
Example 3: Script wrapper
python3 -m oom -t 1024 examples/for_example_3.py
Release files for oom 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oom-0.1.0.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oom-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / oom-0.1.0.tar.gz
| Download URL | oom-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0b3ef4a771a8a208dc89700fa4ad51fab55cf12c16c4f7c54641c399c8b407b
|
|
BLAKE2b-256 checksum How to use checksums |
c9947010805c515c1b83ae44cf81fecb6252d49762e1bcb10d3c1ddabfc64297
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
|
Release files / oom-0.1.0-py3-none-any.whl
| Download URL | oom-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1bad65ed3f588aeb2827cfcb45dc839cca6ac4b2c9c0e3b0edd99da66473fd1
|
|
BLAKE2b-256 checksum How to use checksums |
8c4801fa1038d79393879c79471c766c9bb4e00eb866a0ef1ba825891ed44b3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
|