I have an 500GB external USB disk that is about half full of large files, ~1GB each. I have software that simply opens each file, gets the size and then closes the file. As my code is running, using Process Explorer from SysInternals, I can see the kernel memory steadily increase until an "out of resources" exception is thrown and my application terminates properly. At this point the kernel memory is not freed, computer won't reboot and I have to hard power off.
I've narrowed it down to the opening of the file. I'm using C# and if I use FileInfo() to get the file size this issue goes away (or at least not as much kernel memory is used), however this issue still worries me. Kernel memory is properly freed under normal conditions when the drive is removed, but is there some other way to force it? Any help is appreciated.
I have been unable to reproduce this issue on Windows 7, but am still in the process of trying.
XP Professional, 2GB of RAM, core i7.