add a memory-limit option to the consumer handler command

Exit process when memory limit is reached. Useful to avoid memory leaks in iterations.