Skip to content

A library meant for testing application behavior in out-of-memory conditions with the use of LD_PRELOAD trick.

License

Notifications You must be signed in to change notification settings

dextero/oomalloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOMalloc

A library meant for testing application behavior in out-of-memory conditions with the use of LD_PRELOAD trick.

Requirements

  • Linux
  • glibc - the library contains some glibc-specific code. It will probably not work with alternative libc implementations.

Compiling

cmake . && make

Usage

# enable allocation logs
OOMALLOC_LOG=1 LD_PRELOAD=liboomalloc.so ./your-application

# make the 11th allocation return NULL
OOMALLOC_FAIL_AFTER=10 LD_PRELOAD=liboomalloc.so ./your-application

# make malloc/calloc/realloc fail when heap allocations exceed 10000 bytes
OOMALLOC_LIMIT_HEAP=10000 LD_PRELOAD=liboomalloc.so ./your-application

Acknowledgements

Special thanks to Mateusz Krawiec and Mateusz Kwiatkowski for pointing out issues with the library.

About

A library meant for testing application behavior in out-of-memory conditions with the use of LD_PRELOAD trick.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published