Time-consuming FlushViewOfFile (Windows) and msync (Linux).
To minimize the risk of data loss in the event of a power failure or a system crash, applications should explicitly flush modified pages using the
msync() expensive operations? The reason we ask is that in our application we may not need to minimize the risk of data loss in the event of a system crash.
They are expensive in the sense of moving cache files from memory to disk. Usually you use memory-mapped files to avoid doing this! A normal policy is to refresh as infrequently as your program requirements allow.