commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Smuts" <aaron.smu...@verizon.net>
Subject RE: [simplestore] inital check in
Date Mon, 14 Jan 2002 13:34:25 GMT


> -----Original Message-----
> From: Juozas Baliuka [mailto:baliuka@mwm.lt]
> Sent: Monday, January 14, 2002 3:34 AM
> To: Jakarta Commons Developers List
> Subject: Re: [simplestore] inital check in
> 
> 
> >
> >StoreJanitorImpl: you can register your Memory Stores in
> >this class. A background Thread checks if memory running
> >slow in you JVM and if yes it frees some objects out of the
> >registered Stores.
> 
> Hi,
> I think it is better to use java.lang.ref.* to solve problems related
to
> memory management.

Not if you want to do something with the elements, like keep the
recenmtly used ones around and maybe flush the elements that aren't
being used to disk. . . . 

The problem is that in most caches you can set the number of elements to
be held in memory, but not the size, so you have to sort of guess how
many you want to keep around.  You could pass in an estimated size and
let the cache keep track of the total, but that's not really any better.
So, some sort of background cleanup might be nice.

> Application threads are not permitted  in EJB container and I believe
GC
> will do it better.
> 
> It is from JDK documentation :
> "Soft reference objects, which are cleared at the discretion of the
> garbage
> collector in response to memory demand. Soft references are most often
> used
> to implement memory-sensitive caches. "
> 
> 
> 
> 
> >Have fun
> >   Gerhard
> >
> >
> >---------------------------------
> >Never share a foxhole with anyone
> >braver than you are.
> >---------------------------------
> >
> >
> >
> >--
> >To unsubscribe, e-mail:   <mailto:commons-dev-
> unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail: <mailto:commons-dev-
> help@jakarta.apache.org>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-
> help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message