Storing in Memory is fast, but when the JVM restarts your processed Objects are gone and
must be processed again, although they didn't have changed. What a waste of CPU time.
If configured, the MRUMemoryStore will keep your objects not only in memory, rather also on
the filesystem. When calling the store()
method, objects are pushed on a stack,
which is processed by a "writerthread" in the background. This thread pops the object from the
stack and serialize it to the fs. So the objects are asynchron written to the filesystem,
to keep the performance fast. The thread sleeps and awakes only, when one or more objects
are pushed on the stack. But only CacheStreamObject's and CacheEventObject's in the moment
are stored on the filesystem.
If you restart your application memory is clean. When you request an object with the get()
method the filesystem is checked if the requested object is available, deserialize it and give
it back to the caller. After all the store()
method is called and the
deserialized object is stored in memory for further usage.