Skip to main content

inject memory allocation faults

Project description

Debug tool for Python injecting memory allocation faults to simulate a low memory system to test how your application handles MemoryError exceptions.

pyfailmalloc is based on the PEP 445Add new APIs to customize Python memory allocators” and so requires at least Python 3.4.

API

  • failmalloc.enable(range: int=1000): schedule a memory allocation failure in random.randint(1, range) allocations.
  • failmalloc.disable(): cancel the scheduled memory allocation failure

The version can be read from failmalloc.__version__ as a string (ex: "0.1").

Changelog

Version 0.2 (2015-01-27)

  • Support Python 3.5: hook also calloc(), support the new PyMemAllocatorEx API
  • Add tox.ini to run tests using tox

Version 0.1 (2013-07-08)

  • First public version

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pyfailmalloc-0.2.tar.gz (10.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page