内存不足,cache里面缓存的对象会被强制释放..... 怎么才能不让其强制释放?
最近做了个网站。。 我的机器是512M的内存。在用cache的时候除了点问题。。这里想问问 Cache.NoAbsoluteExpiration的作用,不是永不过期吗?怎么还是被gc回收。。。 哪位大哥能说一下原理。顺便说一下如何才能不被回收?感谢
建立缓存:
context.Cache.Add("test1f", "testdata", null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), System.Web.Caching.CacheItemPriority.Normal, null);string test = string.Format("{0}", context.Cache["test1f"]);