A
Alphapage
Hello,
I have built an object which does some jobs on a particular server.
There can have lots of this object running concurrently.
I want to know what is the best way to optimize my application:
- keep all those objects alive in memory without any timeout (the object is
built one time per user, then disposed when the user exits).
- as I can rebuild the object, I can build the object, execute the job once,
then dispose this object each time the user asks to run a method.
The first solution costs a lot of memory, but the application will be more
responsive (the object has not to be rebuilt).
The second one will cost less memory usage (if users doesn't stress the
server).
So my question is:
Is it better free memory as soon as possible, even if the server can have
stress period or is it better to keep these objects alive to increase the
performance ?
Will the second one slow the server dramatically during a stress period ?
Thanks in advance for your help.
I have built an object which does some jobs on a particular server.
There can have lots of this object running concurrently.
I want to know what is the best way to optimize my application:
- keep all those objects alive in memory without any timeout (the object is
built one time per user, then disposed when the user exits).
- as I can rebuild the object, I can build the object, execute the job once,
then dispose this object each time the user asks to run a method.
The first solution costs a lot of memory, but the application will be more
responsive (the object has not to be rebuilt).
The second one will cost less memory usage (if users doesn't stress the
server).
So my question is:
Is it better free memory as soon as possible, even if the server can have
stress period or is it better to keep these objects alive to increase the
performance ?
Will the second one slow the server dramatically during a stress period ?
Thanks in advance for your help.