Skip to main content

A memory profiler for data batch processing applications.

Project description

The Fil memory profiler for Python

Fil a memory profiler designed for data processing applications. At the moment it only runs on Linux and macOS.

Your code reads some data, processes it, and—uses too much memory. What you need to reduce is peak memory usage.

And that's exactly what Fil will help you find: exactly which code was responsible for allocating memory at peak memory usage.

For more information see https://pythonspeed.com/products/filmemoryprofiler/

Installation

To install:

$ pip install filprofiler

Measuring peak (high-water mark) memory usage

Instead of doing:

$ python yourscript.py --input-file=yourfile

Just do:

$ fil-profile run yourscript.py --input-file=yourfile

And it will generate a report.

Debugging out-of-memory crashes

First, run free to figure out how much memory is available—in this case about 6.3GB—and then set a corresponding limit on virtual memory with ulimit:

$ free -h
       total   used   free  shared  buff/cache  available
Mem:   7.7Gi  1.1Gi  6.3Gi    50Mi       334Mi      6.3Gi
Swap:  3.9Gi  3.0Gi  871Mi
$ ulimit -Sv 6300000

Then, run your program under Fil, and it will generate a SVG at the point in time when memory runs out:

$ fil-profile run oom.py 
...
=fil-profile= Wrote memory usage flamegraph to fil-result/2020-06-15T12:37:13.033/out-of-memory.svg

You've found where memory usage is coming from—now what?

If you're using data processing or scientific computing libraries, I have written a relevant guide to reducing memory usage.

License

Copyright 2020 Hyphenated Enterprises LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

filprofiler-0.5.3-cp38-cp38-manylinux1_x86_64.whl (551.6 kB view details)

Uploaded CPython 3.8

filprofiler-0.5.3-cp38-cp38-macosx_10_14_x86_64.whl (263.7 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

filprofiler-0.5.3-cp37-cp37m-manylinux1_x86_64.whl (552.2 kB view details)

Uploaded CPython 3.7m

filprofiler-0.5.3-cp37-cp37m-macosx_10_14_x86_64.whl (263.7 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

filprofiler-0.5.3-cp36-cp36m-manylinux1_x86_64.whl (551.4 kB view details)

Uploaded CPython 3.6m

filprofiler-0.5.3-cp36-cp36m-macosx_10_14_x86_64.whl (263.7 kB view details)

Uploaded CPython 3.6mmacOS 10.14+ x86-64

File details

Details for the file filprofiler-0.5.3-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: filprofiler-0.5.3-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 551.6 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for filprofiler-0.5.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7363b129f0c04ca38d8c816c3c03ed1133dd0c1da7a8ca192e97d5edc4281630
MD5 99bc20ab4bfb21826e93f276223e17ea
BLAKE2b-256 1b0e8894275c75fe40816dcfa5342589d3ed8cac453fc409528838945e5ea7da

See more details on using hashes here.

File details

Details for the file filprofiler-0.5.3-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: filprofiler-0.5.3-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 263.7 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for filprofiler-0.5.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d66bf93d0779ba2870b30de64057add827848620098dc41259cee26d3a130355
MD5 bcff61c18200377c4d62f4f2327ac329
BLAKE2b-256 1dda993d978d3d148f71a2d69495db4a206b66dbe9622cf1b55899c3be2291fe

See more details on using hashes here.

File details

Details for the file filprofiler-0.5.3-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: filprofiler-0.5.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 552.2 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for filprofiler-0.5.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bf9ca1b671135deb7fa847c137930ab9ff88bdee28b16798536e42f235b84a06
MD5 91d3a203ff92a0b9b1128aabe2ac8cf2
BLAKE2b-256 b0fc1e41aa3ec610dd5a6a5119439014c554566ffa83ec11855481b434ea3a1d

See more details on using hashes here.

File details

Details for the file filprofiler-0.5.3-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: filprofiler-0.5.3-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 263.7 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for filprofiler-0.5.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2ba80b2d06b83ec293c392212e7e4f384e3beb61acffdfe794e36fa8251f7623
MD5 1c2d03eb52b7c45e96ce2e815c8e8e1e
BLAKE2b-256 d0d17692fcc4d42f8dad585f03ee3ad1e8eff011c1780e8a413f89155ff28435

See more details on using hashes here.

File details

Details for the file filprofiler-0.5.3-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: filprofiler-0.5.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 551.4 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for filprofiler-0.5.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 88c491e32f2db715b2edeff38aada9074ba431e90cd749de0696abf45e55706c
MD5 9520405c20d80216b3381c4621b306df
BLAKE2b-256 fa42333ea3ead74d3b9442fc26ae2d4ccdc4f1be19f7e9f70c8b7e5c3c5a447f

See more details on using hashes here.

File details

Details for the file filprofiler-0.5.3-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: filprofiler-0.5.3-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 263.7 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for filprofiler-0.5.3-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0e26f9f195cbba20a5e11b7723c4bf00c72603e3c94d5b163e9c316253e2c839
MD5 628c503deb1d5f8eff1565b0ed16c08b
BLAKE2b-256 7c744538545e2e64690fb58aba4ee6c8133d79aaefd99260af2a0e58127d2cb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page