Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/srgchrksv/memory-profiler

Example of memory usage investigation with memory-profiler
https://github.com/srgchrksv/memory-profiler

benchmarks memory memory-management memory-profiler mprof python ram

Last synced: 4 days ago
JSON representation

Example of memory usage investigation with memory-profiler

Awesome Lists containing this project

README

        

# memory-profiler

When processing large datasets it is important to use memory with maximum efficiency. Or you can get out of RAM, job will not be done and machine can become unresponsive.

### Example of memory usage investigation

Our task is to apply face mesh on each image from a dataset. For face mesh we will use google's mediapipe package.

*First example is creating an instance of a very complex object FaceMesh() on each iteration.*
![plots/linear.png](plots/linear.png)

*Second example is creating and closes an instance of a very complex object FaceMesh() on each iteration.*
![plots/logn.png](plots/logn.png)

*Third example once creates an instance of a very complex object FaceMesh() and reuses it on each iteration.*
![plots/constant.png](plots/constant.png)

## To run memory profiling benchmarks
Install required packages with `pip install -r requirements.txt`

Have a `./images` directory with images.

Check and run `profiling.sh`