Allow to disable memory limit at compilation time

Fixes #396