Conceptually, there are three kind of memories: Short-Term Memory (STM), Working Memory (WM) and Long-Term Memory (LTM). Basically, WM includes STM and it is in RAM. LTM is the database and it is stored on disk.
With parameter
DbSqlite3/InMemory set to true, everything is stored in RAM. Beware what when set to true, the database is written on disk only on exit, so if the robot/computer crashes, we cannot recover the map created so far.
For more details about STM, WM and LTM, see the paper:
Appearance-Based Loop Closure Detection for Online Large-Scale and Long-Term Operation (e.g., beginning of Section III)
cheers,
Mathieu