SQLite Forum

Empty journal files left on disk after connection was gracefully closed
Login
The WAL file contains the write ahead log itself. The shm file contains pointers to specific locations inside the WAL file and allows them to be found quickly, without having to read through the whole WAL file.

Therfore, the shm file is crucial to WAL mode, even if there is only a single thread in a single process accessing any given database. It is also what allows multiple threads (irrespective of their location in one or more processes) to cooperate in WAL mode.