Hi to all,
we have quite a large data model consisting of about 500 persistent classes, 6000 properties and 500 associations.
Since the model is highly interconnected with associations, I believe we need to load all of the resulting mapping files at startup.
I can live with the startup time it takes to read the mappings and build the session factory. It takes about 5 seconds on me dev-machine. In fact, I think it is very fast if I consider all the work that needs to be done.
What worries me more is the memory consumption. Right after having built the session factory, my app already needs 50 mb. Most of this memory is alloceted in private memory segments and cannot be shared among processes. The memory consumtion seems to be related to the Persisters that are created during startup.
We plan to run our app's on Terminal Servers or Citrix Servers. So I think this memory footprint will cause us problems.
Since in normal usage of the application, an end-user will typically not use all features of the app, most of the available classes ill never be used. The problem is: I don't know in advance which classes will get used and which not.
So my idea is: if there would be a way to create the EntityPersister only on demand, whenever the class is actually used for the first time, we could reduce the footprint to what is really needed.
Is there a way to do this?
Do you think such a feature would make sense and could be accomplished?
Is there another way to avoid this problem?
Thanks for any input.
|