Runtime-configurable TOTAL_MEMORY. Closes #1.