by   February 16 2011   
Response object error ASP 0251 : 80004005 Response Buffer Limit Exceeded z.asp line 0 Response object error 'ASP 0251 : 80004005' Response Buffer Limit Exceeded /yourasppage.asp, line 0 Execution of the ASP page caused the Response Buffer to exceed its configured limit. This is a tough one to crack if you use allot of For loops..

Response Buffer Limit Exceeded

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

This is a tough one to crack if you use allot of For loops.

Update: July 9, 2010: Be sure to check your buffer limits in your IIS server. Most likely it's correct and you have a loop that isn't ending. But check it anyway.


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

Updated: 6-1-2012

I've found many are looking at this issue again and I thought it might be a good idea to add some troubleshooting tips to the mix.

I'm still running sites in ASP SQL so don't be shy about asking for help if your a .NET Pro and ASP Classic seems to much like a history lesson. Send your code sample to the service desk and I'll get it.

I saw the Response Buffer Limit Exceeded only when a data lookup or loop was not ended.

The "Response.Buffer = True" is set.

Sometimes we overlook our For Next scripts.

I've had this Response.Buffer limit reach on a few pages that I made years ago using FOR NEXT and just by limiting the actual code I was able to debug to the level that identified the one line of code that was never ending.

Replace one or more of your FOR NEXT with the DO WHILE LOOP and put some limits on your loops.

The Response Buffer Limit should display it's face often enough to troubleshoot it's line of code.

Example:

For x = 1 To 4

// stuff to run

Next

I know this For statement will pass 4 times because I have given it a limit.

If you use a statement like:

For x = 0 to Unbound(i)

Next

Then the var i will be the total passes this script with make. If you have a variable that is very large the For Next step might take too long in most cases and without limits it will cause a memory problem.

Try debugging your code by replacing those unknown or larger For statements with a Do While and make your limits fixed or if you need to count up or down it will be faster.

Example:

Dim strCounter1, strVarTotal

strCounter1 = 0

strVarTotal = 10 'your Unbound(i) 'i = your loop count total

Do While strCounter1 < strVarTotal

'// do stuff

Loop

You should find the problem script to really fix it. I had a IP lookup script that was looping more than 90,000 records at one time and adding the records to the buffer caused the problem. Writing the code differently and limiting the amout of returned data often corrects this issue.

Below are the older notes. I've added this since I noticed more looking at the issue. I can write working examples if any of you need them. It would be just creating the same error with code that I know can overload any buffer.

If you have a tough code assignment and it's your site I'll help when I can. But first, get those For Next out and limit the return or loops for the Do While. Take control of that old ASP Code or you'll find yourself working late nights and weekend over something so simple.

Just remember, Buffer or the max memory any single page can take has been reached so look for something that is really holding allot of data in a variable.

Function Test()

Response.Flush

End Function

Use that flush even with Response.Buffer=True and you'll start seeing what your code is doing. I flush data in debug mode often to see just what is happening before that dang error line 0 or buffer limit reached happens.

>>> Older Notes <<<

Mostly I've seen this error when I code with For Loops that don't have limits on the number of times the next is called.

What I started doing which seems to be helping is changing the For Next to Do While condition.

I'm not 100% sure if this is going to help but I have seen a drop in the number of times this error is displayed.

The On Error Resume at the top of the ASP page doesn't seem to do anything and Error Trapping on Line 0 fails every time.

Without seeing the code you are running all I can do is suggest things based on my experience with this error.

1. Query Strings that are nText or nvarchar should be shortened for the output.

To debug this error modify your code by limited the length of a few stings then test until everything returns without an error.

I used Left(strString,100) on nvarchar and
Left(strString2,150) on nText to find what variable was to long.

Next I used the Response.Flush. This will work within any loop you have and will help clear up buffer memory.

But, be careful about your script timeouts. Memory vs. Time. Make it small and short.

Then you can always drill down your query which if you are seeing this error would be the best method. Select more Where And to get just what is needed on the display.

In short you're running a query that is returning to much data for the Response.Buffer = True .

Debugging is simple with the Length limiting.
Once you find the strings that are causing the issue you can start working on the code output a little better.

quote:Originally posted

Response object error 'ASP 0251 : 80004005'

Response Buffer Limit Exceeded

/yourasppage.asp, line 0

Execution of the ASP page caused the Response Buffer to exceed its configured limit.

&nbsp;

I have seen the Response Buffer Limit error when a query returns results that are over 4MB in size.

4MB IIS Buffer Limit:
From Microsoft:

quote:This issue occurs because of a change in behavior that was introduced in IIS 6.0 and added to IIS 5.0. These versions of IIS enforce a default ASP response buffer limit of 4 MB. This limit prevents large ASP responses from adversely affecting the IIS process that hosts the Web application. If an ASP request generates a response that is larger than the configured buffer limit, you experience the symptoms that are mentioned in the "Symptoms" section.

It's typically a column search that is not ending or repeating the same records.
You would have to post your code to be able to tell you what is causing this error but due to the line number 0 it's an SQL statement that is most likely flooding memory.

Resource of Error Code: http://support.microsoft.com/kb/925764

Review: Recreated error on local IIS server by creating a endless loop.

Response object error ASP 0251 : 80004005 Response Buffer Limit Exceeded z.asp line 0 Response object error 'ASP 0251 : 80004005' Response Buffer Limit Exceeded /yourasppage.asp, line 0 Execution of the ASP page caused the Response Buffer to exceed its configured limit. This is a tough one to crack if you use allot of For loops..