Open lxqaoliao opened 1 month ago
Yes, it will require quite a lot of memory by design. The basic idea of EclipseStore is to keep data in memory to maximize access speed during runtime. When the storage manager is started it will load all persisted data into memory recreate the whole persisted object graph except lazy loaded parts.
An empty EclipseStore instance requires just some few MB memory. The more important part are the management data required for each persisted object instance. To estimate the memory usage you can calculate round about 188 Bytes per stored Object. LazyReferences require additional 104 Bytes even if unloaded. Using them with very small objects may counterproductive. Microstream also uses an internal off-heap cache that can become quite large. If the default configuration of that cache is not suitable have look here. And, last but not least, your java objects also require memory.
Can I shut down to free up memory after use?
Or is there a way to directly release all registered instances?
You can use Lazy Loading and Lazy Collections. This will load and unload data as required.
However, if you use this in an uncareful way, it could get rather slow due to a lot of loading and unloading of data.
May I ask if starting Embedded Storage Manager without shutting it down and with hundreds of thousands of data, would it consume a lot of memory?