You should maybe take a look into the various caching-libraries available
(ehcache, swarmcache, jboss-treecache etc.) - these libraries deal with
cacheing, which is a little different from what the
application/session-objects offer, as application and session have to be
absolutely reliable. If you store something in it, you can safely expect to
find it again. Therefore, this objects cannot deal with things like running
out of memory - they cannot simply throw out objects, when things get too
crowded. 

On the other hand, Cacheing-Systems always have policies to deal with such
situations(eg. Swarm-cache dynamically adapts to your usage-patterns) and
can throw out old or un-needed objects, whenever it gets too crowded -
therefore, you cannot always expect an object that you put into the cache to
be still present after a while - so you have to deal with refetching it,
when you have nop cache-hit. You may want to look into O\R-Mapping
Frameworks  like hibernate: they already have these caches built in and take
care of re-fetching objects, when they have expired from the cache.

>From a pure memory point of view, there is no difference. If you absolutely
need your complex object 100% of the time, it makes no difference, if you
keep it in the application or if you put it in an in-memory cache. 

Hope this helps
stf   

> -----Original Message-----
> From: Daxin Zuo [mailto:[EMAIL PROTECTED] 
> Sent: Sonntag, 10. April 2005 19:23
> To: Tomcat Users List
> Subject: Application Data sharing -- store large object?
> 
> In my program, an object that contains a large amount of data 
> (complicated data strustures) is used in many pages. When I 
> start doing it, I heard that it is better to not store large 
> object in Application. So I let the program create a new one 
> when ever this object is needed. Now I like to question if it 
> is good to put this object in Application.
> 
> Thanks.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to