I've got a code base with lots of this:
byte[] contents = FileUtils.FileToByteArray(FileOfGartantuanProportions);
I don't control my IIS server, so I can't see the system log or do instrumentation, I just get to see my request fail to return (white page of death) and sometimes YSOD with Out of Memory error.
Does anyone have a rule of thumb for what is the most data you can load up into memory before IIS5 or IIS6 will kill the work process or just keel over and die?
Or better yet, is there an API call I an make, something like:
if(!IsEnoughMemoryFor(FileOfGartantuanProportion.Length)) throw new SomeException() ;
On my XP Pro workstation I can get get an ASP.NET page to successfully deal with a very large byte array in memory, but these results obviously weren't applicable to a real shared server.