add readonly option to TestMemory