In course of development of our Driver Verification project we needed a reliable resource limiting script. At first it was supposed to simply limit one process in time and memory consumption, so I downloaded a simple script I found via Google, and used it in our project.

As the time went, the script grew with more features. We found out that it doesn't take child processes into account, and I made it to doing so, rewriting the script completely (in Perl instead of Shell). We needed to collect the CPU usage statistics, as well as limit it, and my peer added such functionality to the script. We needed to detect deadlocks by observing that the processes controlled are stalled, and this was added as well.

Now the time limiting script is a feature-rich and a simple solution for controlling resource consumption of a black-box program. Therefore, I decided to make a separate project from this script alone, because, as far as I know, there's nothing like this script out there, available as open source.

The project is hosted at GitHub; you may download it from there, as well as from its homepage hosted here.

The initial article that described how the script is implemented was also updated to reflect the latest findings and usage experience.

In a nutshell, this was just an announcement of my first own small open source project. I doubt it will get much traction, but let's see how it will go...

Comments imported from the old website

Ayrat (id) on 14 May 2011 commented:

Привет, Даня! http://www.smtcomp.org/2011/TreeLimitedRun.c это на сях похожая штука. умеет: лимиты: wall cpu, user cpu, memory, учитывает дочерние процессы, убивает их Правда у неё есть косяк: иногда убивает процессы зомби, запущенные после старта скрипта

Айрат.

Pavel Shved on 18 May 2011 commented:

@Ayrat, yeah, it looks very similar, and is implemented just the way I described in my blog post after a large edit. No wonder: SMT competition and Linux Driver Verification both deal with external tools that solve complex problems and tend to consume time and memory. (And, in turn, by the way, some of our tools in LDV use SMT solvers :).) Still, our solution has more features, although should be a bit slower due to language choice (Perl over C).

И кстати, Даня — это не я, а свосем другой человек.