Caching Application Block for Large amount of files?

Topics: Caching Application Block
Mar 6, 2009 at 12:58 PM
Hello,

I develop an Winform Client Application which edit large files stored in a server, for performance reasons i would like to catch them in client machine for some days. I tried to use IsolatedStorage CAB feature to achieve this, at the first trials no so big problems

ICacheManager filesCache = CacheFactory.GetCacheManager();
...
MemoryStream memoryStream = GetStreamFromServer();
filesCache.Add(fileInfo.Name, memoryStream);
...

However after cache large amount of files, the memory of my application grows a lot. and restarting my application all the files are load into memory becoming my application start slower and finally result OutOfMemoryException

I read by design of CAB is the expected behavior since when the cache manger is created it loads from storage the persisted items into Memory.

Can CAB help in this scenario ?
There is a way to get a Load on Demand item cache and released from memory without released from file persisted item?

Mar 9, 2009 at 3:54 AM
Hi,

I think that is not possible, according to this thread, http://entlib.codeplex.com/Thread/View.aspx?ThreadId=9229 that there is an assumption that the data is written to the memory and written to a backing store optionally. What is your "maximumElementsInCacheBeforeScavenging" value?

Please see this threads:
http://entlib.codeplex.com/Thread/View.aspx?ThreadId=14669
http://entlib.codeplex.com/Thread/View.aspx?ThreadId=40684
http://entlib.codeplex.com/Thread/View.aspx?ThreadId=19898
http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=11938
http://entlib.codeplex.com/Thread/View.aspx?ThreadId=19070


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com