BinaryWrite and w3wp.exe memory leak

Discussion in 'ASP General' started by info@pstruh.cz, Apr 24, 2007.

  1. Guest

    Hi.
    I try to download very large file using ASP and BinaryWrite. But ASP
    +W3WP allocates a lot of memory. I write the file using blocks. It
    works great in IIS4 and 5, does not work in IIS 6.

    Sample code causing the error is bellow. The code writes 100000B
    blocks, with buffer=false, but it allocates 1GB of memory, not 10kB as
    expected!

    Thank you for help
    Antonin

    <%
    Const BlockSize = 100000
    Const DownloadSize = 1000000000

    Dim BlockData, BlockCounter
    BlockData = space(BlockSize/2)
    'Switch off buffer.
    Response.Buffer = False

    'This is download
    Response.ContentType = "application/x-msdownload"


    For BlockCounter = 1 To DownloadSize Step BlockSize
    Response.BinaryWrite BlockData
    Next
    %>
    , Apr 24, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. z. f.
    Replies:
    15
    Views:
    4,525
    z. f.
    Dec 2, 2004
  2. AN
    Replies:
    4
    Views:
    15,106
    Scott Allen
    Jul 21, 2005
  3. Chris
    Replies:
    1
    Views:
    2,917
    Jim Cheshire
    Jan 12, 2006
  4. venom00

    w3wp.exe (ASP .Net) eating memory

    venom00, Nov 17, 2009, in forum: ASP .Net
    Replies:
    3
    Views:
    5,327
    venom00
    Nov 18, 2009
  5. venom00

    w3wp.exe (ASP .Net) eating memory

    venom00, Nov 17, 2009, in forum: ASP General
    Replies:
    1
    Views:
    864
    Bob Barrows
    Nov 17, 2009
Loading...

Share This Page