IIS crashes when ASP loops through large txt file?

Results 1 to 3 of 3

Thread: IIS crashes when ASP loops through large txt file?

  1. #1
    Join Date
    Dec 1969

    Default IIS crashes when ASP loops through large txt file?

    I&#039;m having real trouble locating the source of a problem with my ASP script. This ASP script reads a large txt file (sometimes 30Mb +) one line at a time, does some parsing of the line to break it down in to individual variables ready to be used in an INSERT SQL statement. Then loops round and repeats the process. <BR>Having processed about 40,000 lines the webserver (IIS) crashes and the file is never completely finished.<BR>I have a feeling it may be due to memory running out as the process monitor max&#039;s out at 100% before crashing.<BR>Any ideas would greatly received.<BR><BR>wboyd@tibus.com<BR>

  2. #2
    Crai Guest

    Default How are you doing it?

    Are you loading the file in with OpenTextStream and then each file with ReadLine?<BR><BR>If so, there are some other ways of opening and reading large text files. I read a tutorial on 4guys (I think) a few weeks ago and they showed that opening and reading a 10mb file was EXCEPTIONALLY faster if you used "ReadBytes(n)" rather than "ReadLine".<BR><BR>You would then of course have to split the file by line breaks, but it may be faster...<BR><BR>Either that or create a VB app to do it and then call it from within the ASP page using the Windows Scripting Host.<BR><BR>Of course, I assume this page isn&#039;t called often - you don&#039;t want x million visitors all having to load a 30MB file into memory when they hit the site!<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default RE: IIS crashes when ASP loops through large txt f

    Server.ScriptTimeout = newvalue<BR><BR>also, check that you are releasing the "completed" parses from memory before strting new ones! definately using too much memory, so release the values by<BR><BR>set objLineRead = nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts