/ram-is-mine

Enforce RAM usage limit for programs.

Primary LanguageCGNU General Public License v2.0GPL-2.0

ram-is-mine

Ensure that programs do not use more RAM memory than they are allowed to.

Some programs have their own malloc implementations and they do not return RAM to the OS.

I wanted to try this way. I could try to use ulimit and run the process with its own user, but I think it will be handy to have this program around.

It will add a bit of overhead for small allocations. This will be optimized later.

Usage

MY_RAM_LIMIT=$((1024*1024*1024*2)) LD_PRELOAD_64=./ram-is-mine.so LD_PRELOAD=./ram-is-mine.so test_1

Replace test_1 with your program.

Status

Unstable. It will crash your computer and kill the cat.

It is not released yet, it should be completed soon.

Build UNIX

Requirements:

Tested in Ubuntu 14.04.

Credits