A better (working) way to limit memory usage.
Add a test for changing limits.