Response Buffer Limit Exceeded
Asked Answered
A

12

49

I am running a simple query to get data out of my database & display them. I'm getting an error that says Response Buffer Limit Exceeded.

Error is : Response object error 'ASP 0251 : 80004005'
Response Buffer Limit Exceeded
/abc/test_maintenanceDetail.asp, line 0
Execution of the ASP page caused the Response Buffer to exceed its configured limit.

I have also tried Response.flush in my loop and also use response.buffer = false in my top of the page, but still I am not getting any data.

My database contains 5600 records for that, Please give me some steps or code to solve the issue.

Arak answered 11/2, 2011 at 10:36 Comment(0)
E
59

I know this is way late, but for anyone else who encounters this problem: If you are using a loop of some kind (in my case, a Do-While) to display the data, make sure that you are moving to the next record (in my case, a rs.MoveNext).

Enigmatic answered 12/3, 2013 at 20:52 Comment(3)
It was as simple as that.Maren
I upvoted this a while ago (maybe 4 o 5 months ago or even more). I cannot upvote again, but I need to comment how this answer solved my problems againTavish
OMG you just ended a week of asp/.net hell for me. I don't care how much hate I get you deserve the most thanks and +1's in the megaverse.Delouse
O
55

Here is what a Microsoft support page says about this: https://support.microsoft.com/en-us/help/944886/error-message-when-you-use-the-response-binarywrite-method-in-iis-6-an.

But it’s easier in the GUI:

  • In Internet Information Services (IIS) Manager, click on ASP.
  • Change Behavior > Limits Properties > Response Buffering Limit from 4 MB to 64 MB.
  • Apply and restart.
Overstuff answered 24/2, 2012 at 16:36 Comment(1)
Worked for me. 67108864 is the number. Also increased the Script Time-out.Banausic
W
35

The reason this is happening is because buffering is turned on by default, and IIS 6 cannot handle the large response.

In Classic ASP, at the top of your page, after <%@Language="VBScript"%> add: <%Response.Buffer = False%>

In ASP.NET, you would add Buffer="False" to your Page directive. For example: <%@Page Language="C#" Buffer="False"%>

Whisler answered 26/6, 2012 at 6:59 Comment(2)
When I turn it off, I get ASP 0159 Buffering must be on.Bunyan
@Bunyan - make sure you put it at the top of the page. I got the same error because I put it inside the <HTML> section.Narda
L
12

I faced the same kind of issue, my IIS version is 8.5. Increased the Response Buffering Limit under the ASP -> Limit Properties solved the issue.

  1. In IIS 8.5, select your project, you can see the options in the right hand side. In that under the IIS, you can see the ASP option.

ASP option

  1. In the option window increase the Response Buffering Limit to 40194304 (approximately 40 MB) .

Increase buffer limit

  1. Navigate away from the option, in the right hand side top you can see the Actions menu, Select Apply. It solved my problem.

Apply settings

Lolly answered 2/12, 2016 at 14:45 Comment(0)
A
9

If you are not allowed to change the buffer limit at the server level, you will need to use the <%Response.Buffer = False%> method.

HOWEVER, if you are still getting this error and have a large table on the page, the culprit may be table itself. By design, some versions of Internet Explorer will buffer the entire content between before it is rendered to the page. So even if you are telling the page to not buffer the content, the table element may be buffered and causing this error.

Some alternate solutions may be to paginate the table results, but if you must display the entire table and it has thousands of rows, throw this line of code in the middle of the table generation loop: <% Response.Flush %>. For speed considerations, you may also want to consider adding a basic counter so that the flush only happens every 25 or 100 lines or so.

Drawbacks of not buffering the output:

  1. slowdown of overall page load
  2. tables and columns will adjust their widths as content is populated (table appears to wiggle)
  3. Users will be able to click on links and interact with the page before it is fully loaded. So if you have some javascript at the bottom of the page, you may want to move it to the top to ensure it is loaded before some of your faster moving users click on things.

See this KB article for more information http://support.microsoft.com/kb/925764

Hope that helps.

Akim answered 28/12, 2012 at 17:16 Comment(0)
B
5

Thank you so much! <%Response.Buffer = False%> worked like a charm! My asp/HTML table that was returning a blank page at about 2700 records. The following debugging lines helped expose the buffering problem: I replace the Do While loop as follows and played with my limit numbers to see what was happening:

Replace

Do While not rs.EOF

'etc .... your block of code that writes the table rows

rs.moveNext

Loop

with

Do While reccount < 2500

if rs.EOF then recount = 2501

'etc .... your block of code that writes the table rows

rs.moveNext

Loop

response.write "recount = " & recount

raise or lower the 2500 and 2501 to see if it is a buffer problem. for my record set, I could see that the blank page return, blank table, was happening at about 2700 records, good luck to all and thank you again for solving this problem! Such a simple great solution!

Blim answered 28/2, 2016 at 20:31 Comment(0)
D
3

You can increase the limit as follows:

  1. Stop IIS.
  2. Locate the file %WinDir%\System32\Inetsrv\Metabase.xml
  3. Modify the AspBufferingLimit value. The default value is 4194304, which is about 4 MB. Changing it to 20MB (20971520).
  4. Restart IIS.
Desirous answered 15/6, 2014 at 14:7 Comment(0)
E
1

One other answer to the same error message (this just fixed my problem) is that the System drive was low on disk space. Meaning about 700kb free. Deleting a lot of unused stuff on this really old server and then restarting IIS and the website (probably only IIS was necessary) cause the problem to disappear for me.

I'm sure the other answers are more useful for most people, but for a quick fix, just make sure that the System drive has some free space.

Eckart answered 22/5, 2014 at 22:49 Comment(0)
F
0

I rectified the error 'ASP 0251 : 80004005' Response Buffer Limit as follow:

To increase the buffering limit in IIS 6, follow these steps:

Click Start, click Run, type cmd, and then click OK. Type the following command, and then press ENTER: cd /d %systemdrive%\inetpub\adminscripts Type the following command, and then press ENTER: cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit LimitSize Note LimitSize represents the buffering limit size in bytes. For example, the number 67108864 sets the buffering limit size to 64 MB. To confirm that the buffer limit is set correctly, follow these steps:

Click Start, click Run, type cmd, and then click OK. Type the following command, and then press ENTER: cd /d %systemdrive%\inetpub\adminscripts Type the following command, and then press ENTER: cscript.exe adsutil.vbs GET w3svc/aspbufferinglimit

refers to https://support.microsoft.com/en-us/kb/944886

Florie answered 10/11, 2016 at 2:7 Comment(0)
C
0

If you are looking for the reason and don't want to fight the system settings, these are two major situations I faced:

  1. You may have an infinite loop without next or recordest.movenext
  2. Your text data is very large but you think it is not! The common reason for this situation is to copy-paste an Image from Microsoft word directly into the editor and so the server translates the image to data objects and saves it in your text field. This can easily occupies the database resources and causes buffer problem when you call the data again.
Cherisecherish answered 15/7, 2017 at 16:13 Comment(0)
H
0

In my case i just have writing this line before rs.Open .....

Response.flush

rs.Open query, conn

Historical answered 28/11, 2018 at 8:39 Comment(0)
I
0

It can be due to CursorTypeEnum also. My scenario was the initial value equal to CursorTypeEnum.adOpenStatic 3.

After changed to default, CursorTypeEnum.adOpenForwardOnly 0, it backs to normal.

Illume answered 18/12, 2020 at 11:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.