[Opensource] Getting use of the Cache System

Michael Rimov rimovm at centercomp.com
Sat Jun 15 05:55:39 PDT 2002


At 02:36 PM 6/13/2002 +0300, you wrote:
>Mike, thanks for the clarification.
>
>It turns out that I thought searchAndRetrieveList also cached its results, 
>but it doesn't... Is it meaningful that this method also caches its results?

Actually it isn't that meaningful.  The problem is that since Caches in 
Expresso are passive, there's no way to know if a new record has been added 
that would normally fit into the searchAndRetrieveList() function.  So the 
searchAndRetrieveList() function itself wouldn't have to do a full 
execution each time anyway.

The best way to approach it (as far as I can tell in my head thinking about 
it) is create what "Searches" are performed in your Schema.  Then with a 
few specific [Orion Server calls them Finders, I think] things to cache, 
you could continue to add those to the Finders if the object 
qualified.  It's not an easy issue to tackle, however.

HTH!
                                                 -Mike





>It is easy to put "if (isCached()) addToCache();" for each field 
>retrieved. What do you think?
>
>Turgay
>
>>From: Michael Rimov <rimovm at centercomp.com>
>>Reply-To: opensource at jcorporate.com
>>To: opensource at jcorporate.com
>>Subject: Re: [Opensource] Getting use of the Cache System
>>Date: Wed, 12 Jun 2002 14:07:37 -0700
>>
>>
>>Hi Turgay!
>>
>>I came across that one about 3 months ago and I've been meaning to write 
>>an article about it ever since.
>>
>>Here's the deal:
>>
>>Expresso Cache checks the System available memory before creating a new 
>>'cache'.  The problem in this lies in the JVM.  If current heap 
>>allocation is only 92 Mb even though Max is 256 Mb, the API call will 
>>only return what's left from the current heap allocation, and worse yet, 
>>it doesn't expose what the max potential is.
>>
>>I decided to keep that code in there because it helps to prevent crashes 
>>near a system limit.  However, here's a workaround for that error:
>>
>>-Xmx256m -Xms256m
>>
>>By having the minimum allocation = maximum allocation you're going to get 
>>the best performance and the cache will grow to the maximum that it can.
>>
>>That should take care of the warning messages.
>>
>>The other thing to be aware of is that searchAndRetrieveList() does NOT 
>>cache it's results.  retrieve() DOES however.
>>
>>HTH!
>>                                                 -Mike
>>
>>_______________________________________________
>>Opensource mailing list
>>Opensource at jcorporate.com
>>http://mail.jcorporate.com/mailman/listinfo/opensource
>>Archives: http://mail.jcorporate.com/pipermail/opensource/
>
>
>_________________________________________________________________
>Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/




More information about the Opensource mailing list