问题
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