c++ - Are memory mapped files bad for constantly changing data? -


I have a service that is responsible for collecting a continuous update stream of data from the network. The intention is that the entire data set should be available for use at any time (read only). This means that the latest data messages that comes in the oldest must be accessible to the client code.

The current plan is to use a memory map file on Windows primarily because there is no way to know which part of the data are spread over tens of GB, because the data set is huge, but When this is needed, the client may need to jump around in will.

Memory mapped files fit the bill, though I have said it (written) that they are best for the already defined data set, and do not constantly change. Is it true? What does the landscape described above work with memory mapped files mean a lot?

Or can I improve the data of some recent MBs to keep memory map file better for all the data, so that about 99% of the data in the memory-mapped file is history , But I most recently store, say 100 MB in a different memory buffer. Every time this buffer is completed, I take it to the memory map file and then clear it.

Any data set that is defined and does not change is best!
Memory mapped files usually win on something else - most will cache access in the OS RAM. And the performance will be estimated, when you start swapping, you do not fall from a rock.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -