隔离存储器内存不足异常 [英] Isolated Storage Out-of-memory Exception
问题描述
在将文件写入"隔离存储"时,我经常遇到内存不足异常。
I am getting an exception frequently that out of memory exception while writing the files to "Isolated Storage".
这是我的代码
using (var sourceFile =storage.OpenFile (name,FileMode.Open, FileAccess.Read))
{
BitmapImage bm = new BitmapImage();
using(MemoryStream ms = new MemoryStream(data,0,data.Length))
{                          
ms.Seek(0,SeekOrigin.Begin);
BitmapImage bm = new BitmapImage(); using (MemoryStream ms = new MemoryStream(data, 0, data.Length)) { ms.Seek(0, SeekOrigin.Begin);
bm.SetSource(ms);
bm.SetSource(ms);
}
}
创建一些媒体文件后我正在使系统内存异常....
After created some media files i'm getting System out of memory exception....
我可以通过使用应用程序数据而不是隔离存储来克服此异常吗?
Can i overcome this exception by using Application Data instead of Isolated Storage ?
或
有没有其他或更好的方法来克服此异常?
Is there any alternative or better way to overcome this exception ?
提前完成Thanx .. 。
Thanx in Advance...
推荐答案
有多大你正在创建这些文件?请记住,应用程序存在内存限制:
来自
文档:
应用类型的内存限制
这篇关于隔离存储器内存不足异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!