Skip to content

Memory usage after initializing SessionFactory #1933

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

Closed
danilosingh opened this issue Dec 8, 2018 · 4 comments
Closed

Memory usage after initializing SessionFactory #1933

danilosingh opened this issue Dec 8, 2018 · 4 comments

Comments

@danilosingh
Copy link

We have a desktop application with 470 entities. The problem is that the application consumes more around 150MB in memory just when initializing the application, and of course this increases as the user uses. We have a long-term concern because this domain will grow.
We have clients that use Terminal Service, with many users, and our infrastructure reality in Brazil is precarious, which has generated problems of slowness in the system.
Is it possible to do something to decrease memory consumption at startup?
It would be great if Nhibernate created all the necessary configuration (loaders, proxies, sql strings) only in the first use of the entity, although this means to lose some performance in the first access.
Has anyone ever had this kind of problem? Do you know a strategy to improve?

@namer315
Copy link

namer315 commented Dec 8, 2018

We have the same issue
is there any way to load entities per use only and have the ability dispose them later on
Thanks in advance

@fredericDelaporte
Copy link
Member

fredericDelaporte commented Dec 8, 2018

Related to #1904.

It was about lazy initializing some of the memory consuming data, but due to the bad impact it would have on warm-up (for example for server farms which do application warm-up on newly brought up instances before actually adding them to the farm), it was concluded:

Better to optimize the code in batchers instead.

@danilosingh
Copy link
Author

@fredericDelaporte Could not this be optional?

@fredericDelaporte
Copy link
Member

In fact, duplicate of #1316.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants