Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the issue of storage occupying memory #226

Closed
lxqaoliao opened this issue Jun 14, 2024 · 4 comments
Closed

About the issue of storage occupying memory #226

lxqaoliao opened this issue Jun 14, 2024 · 4 comments

Comments

@lxqaoliao
Copy link

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?

@hg-ms
Copy link
Contributor

hg-ms commented Jun 14, 2024

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.

@lxqaoliao
Copy link
Author

Can I shut down to free up memory after use?

@lxqaoliao
Copy link
Author

Or is there a way to directly release all registered instances?

@Bios-Marcel
Copy link

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.

@eclipse-store eclipse-store locked and limited conversation to collaborators Aug 13, 2024
@fh-ms fh-ms converted this issue into discussion #271 Aug 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants