add configurable heap memory limit