Response buffer help needed

Discussion in 'ASP .Net' started by Steven Bazeley, Apr 4, 2006.

  1. I had a download failure problem with a 95MB wmv file. I thought it was my
    code

    but I could not find anything wrong. So I tested the download by replacing
    the 95MB

    file with a smaller one (20MB). It worked fine. When I contacted my hosting
    company

    this is what they told me.





    (Data streamed through the Response buffer will be held in memory. We allow
    a maximum of 100MB memory usage per site.

    The 100MB memory limit is applied to the site's application process. Your
    site itself is using about 30-50MB on average. So you add 95.1MB on top of
    that and it will go over the 100MB. Once this limit is reached, we restart
    the process, thus resulting in the failure of the download.)



    So the reason for this post is. I don't understand how the response buffer
    works. Why is it that the data in the response buffer is held in memory. In
    my code I always clear the buffer when I'm done with it. How are they
    figuring that my site is averaging 30-50MB?

    I guess I'm just looking for information, so I can do a work around. Any
    pointers would be appreciated.
     
    Steven Bazeley, Apr 4, 2006
    #1
    1. Advertising

  2. Steven Bazeley wrote:
    > I had a download failure problem with a 95MB wmv file. I thought it was my
    > code
    >
    > but I could not find anything wrong. So I tested the download by replacing
    > the 95MB
    >
    > file with a smaller one (20MB). It worked fine. When I contacted my hosting
    > company
    >
    > this is what they told me.
    >
    >
    >
    >
    >
    > (Data streamed through the Response buffer will be held in memory. We allow
    > a maximum of 100MB memory usage per site.
    >
    > The 100MB memory limit is applied to the site's application process. Your
    > site itself is using about 30-50MB on average. So you add 95.1MB on top of
    > that and it will go over the 100MB. Once this limit is reached, we restart
    > the process, thus resulting in the failure of the download.)
    >
    >
    >
    > So the reason for this post is. I don't understand how the response buffer
    > works. Why is it that the data in the response buffer is held in memory. In
    > my code I always clear the buffer when I'm done with it. How are they
    > figuring that my site is averaging 30-50MB?
    >
    > I guess I'm just looking for information, so I can do a work around. Any
    > pointers would be appreciated.
    >
    >


    Are you doing a Response.BinaryWrite? If so, it'll load up the whole
    file and then shove it down the pipe, hence your memory issues.

    Try buffering/streaming the file...

    http://www.cnblogs.com/bestcomy/archive/2004/08/10/31950.aspx

    --
    Craig
    Microsoft MVP - ASP/ASP.NET
     
    Craig Deelsnyder, Apr 4, 2006
    #2
    1. Advertising

  3. Thanks Craig I found the article helpful, and will try the sample code.

    "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> wrote in message
    news:...
    > Steven Bazeley wrote:
    > > I had a download failure problem with a 95MB wmv file. I thought it was

    my
    > > code
    > >
    > > but I could not find anything wrong. So I tested the download by

    replacing
    > > the 95MB
    > >
    > > file with a smaller one (20MB). It worked fine. When I contacted my

    hosting
    > > company
    > >
    > > this is what they told me.
    > >
    > >
    > >
    > >
    > >
    > > (Data streamed through the Response buffer will be held in memory. We

    allow
    > > a maximum of 100MB memory usage per site.
    > >
    > > The 100MB memory limit is applied to the site's application process.

    Your
    > > site itself is using about 30-50MB on average. So you add 95.1MB on top

    of
    > > that and it will go over the 100MB. Once this limit is reached, we

    restart
    > > the process, thus resulting in the failure of the download.)
    > >
    > >
    > >
    > > So the reason for this post is. I don't understand how the response

    buffer
    > > works. Why is it that the data in the response buffer is held in memory.

    In
    > > my code I always clear the buffer when I'm done with it. How are they
    > > figuring that my site is averaging 30-50MB?
    > >
    > > I guess I'm just looking for information, so I can do a work around. Any
    > > pointers would be appreciated.
    > >
    > >

    >
    > Are you doing a Response.BinaryWrite? If so, it'll load up the whole
    > file and then shove it down the pipe, hence your memory issues.
    >
    > Try buffering/streaming the file...
    >
    > http://www.cnblogs.com/bestcomy/archive/2004/08/10/31950.aspx
    >
    > --
    > Craig
    > Microsoft MVP - ASP/ASP.NET
     
    Steven Bazeley, Apr 4, 2006
    #3
    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. Brian Piotrowski

    Response Buffer Limit Exceeded Help Needed

    Brian Piotrowski, Aug 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,084
    Brian Piotrowski
    Aug 27, 2004
  2. =?Utf-8?B?Sm9l?=

    Response.Buffer vs. Response.BufferOutput

    =?Utf-8?B?Sm9l?=, Oct 24, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    9,224
    Vadivel Kumar
    Oct 25, 2005
  3. Raja
    Replies:
    12
    Views:
    24,413
    John Harrison
    Jun 21, 2004
  4. Replies:
    2
    Views:
    607
    sergejusz
    Mar 26, 2007
  5. xingye
    Replies:
    9
    Views:
    276
    Michael Lu
    Apr 19, 2004
Loading...

Share This Page