IOException: Insufficient system resources when there is aplenty

两盒软妹~` 提交于 2019-12-13 18:42:37

问题


I am coming across an error when I am trying to write out a file (~50 MB) I will randomly get the following error:

IOException: Insufficient system resources exist to complete the requested service

I currently have 200+ GB free on the hard drive and about 20 GB free in memory. I am using protobuf to serialize the data out to disk. There are around four threads running similar operations at the same time on different files. There should not be anything else trying to access the file as it was just created with a random GUID. Here is the code I am using to write the information out to disk:

using (FileStream stream = File.Open(file, FileMode.Create, FileAccess.Write, FileShare.None))
{
    Serializer.Serialize<my_object>(stream, data);
}

Can anyone shed any light as to which system resource the IOException is referring to?

Thanks!

来源:https://stackoverflow.com/questions/13866282/ioexception-insufficient-system-resources-when-there-is-aplenty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!