J
John Mark Howell
OK, I've confirmed this: If you use a StreamWriter and don't wrap it in a
using statement, simply calling Close() does not always release the handle.
It does close the file but it appears to leave some type of object
containing a handle out there. I created a simple windows service that
called a method that simply wrote out a string to a file. It ran for a
month, slowly increasing the handles number listed in the Task Manager until
it finally simply hung up without an error. It did not terminate, it simply
did nothing (used no CPU). Wrapping the file I/O code in a using seems to
have eliminated the slowly increasing number of handles.
My environment is:
Windows XP Pro (no service pack)
.Net 1.1 & C#
1M RAM, 120G hd
Has anyone else found this?
using statement, simply calling Close() does not always release the handle.
It does close the file but it appears to leave some type of object
containing a handle out there. I created a simple windows service that
called a method that simply wrote out a string to a file. It ran for a
month, slowly increasing the handles number listed in the Task Manager until
it finally simply hung up without an error. It did not terminate, it simply
did nothing (used no CPU). Wrapping the file I/O code in a using seems to
have eliminated the slowly increasing number of handles.
My environment is:
Windows XP Pro (no service pack)
.Net 1.1 & C#
1M RAM, 120G hd
Has anyone else found this?