Caching Application Block for Large amount of files?

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

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 4:54 AM

I think that is not possible, according to this thread, 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:

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.