struct SomeStruct
{
//some fields, store ~3kb
}
List<SomeStruct> lst = new List<SomeStruct>();
for (int i = 0; i < int.MaxValue; i++)
lst.Add(new SomeStruct(/*...*/)); //somewhere we get OutOfMemory exception
所以...我希望它使用虚拟内存并继续工作,而不是异常
struct SomeStruct
{
//some fields, store ~3kb
}
List<SomeStruct> lst = new List<SomeStruct>();
for (int i = 0; i < int.MaxValue; i++)
lst.Add(new SomeStruct(/*...*/)); //somewhere we get OutOfMemory exception
所以...我希望它使用虚拟内存并继续工作,而不是异常