Is it better to hold the lock in the context of ``flushMemory`` instead of passing it through the call chain?  Feels a bit messy, but I'll be curious for your notes.