Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


What is causing Resourse-Exhaustion-Detector Event in asp.net app

Posted on 2014-08-20
Medium Priority
Last Modified: 2014-08-22
I have a simple logging application which brings down my web service and SQL Server after running for between 24 and 48 hours. While running, Task Manager does not show any shortage of resources. Here is the code (vb.net)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim context1 As HttpContext = HttpContext.Current
            Dim strAuc As String = context1.Request("auc")
            Dim strUID As String = context1.Request("uid")
            Dim strURL As String = context1.Request("url")
            Dim strSQL As String = "insert into tblurl(datetime,auction_id_64,user_id_64,url) VALUES(getdate()," & strAuc & "," & strUID & ",'" & strURL & "')"
            Dim cn As New SqlConnection
            cn.ConnectionString = "Server=n.n.n.n;Database=somedb;User Id=sa;Password=xxxxx;Min Pool Size=0;Max Pool Size =1000;"
            Dim cmd As New SqlCommand
            cmd.Connection = cn
            cmd.CommandType = CommandType.Text
            cmd.CommandText = strSQL
            End Try
            cn = Nothing

        End Try
    End Sub
Question by:jking1234
  • 5
  • 3
LVL 29

Expert Comment

by:Dan McFadden
ID: 40272152
Are there any errors or warnings in the Event Logs?

Author Comment

ID: 40272157
A warning:
Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: sqlservr.exe (3416) consumed 11239366656 bytes, w3wp.exe (4192) consumed 174723072 bytes, and Ssms.exe (2520) consumed 108425216 bytes.

and an error
Unable to create the error log file. Make sure that the error logging directory is correct.

Author Comment

ID: 40272163
The last error before failing was:
Application pool 'DefaultAppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

LVL 29

Expert Comment

by:Dan McFadden
ID: 40272279
More questions:

1. How much RAM does the server have?
2. How is the pagefile configured?
3. Have you tweaked the memory configuration of the SQL instance?  Is SQL Server configured to use all available RAM?

For #2:  http://social.technet.microsoft.com/wiki/contents/articles/13383.best-practices-for-page-file-and-minimum-drive-size-for-os-partition-on-windows-servers.aspx

For #3:  using SQL Server Management Studio, connect to the SQL instance.  Then, in the object explorer, right-click on the server and select properties.  Select the Memory option.  What is configured for "Maximum server memory"?

Author Comment

ID: 40276475
1.   12Gb
2.   Pagefile was not configured (I have set it to 30Gb on C: and 100Gb on D:
3.   Maximum Server memory was 2147483647Mb, (I have set it to 10,000Mb)

I have now rebooted the server and will see how it goes
LVL 29

Accepted Solution

Dan McFadden earned 2000 total points
ID: 40276518
Sounds good.

I would recommend removing the swap file on D:.  There is absolutely no reason for a 100GB swap file.  I use the rule of 1.5 x RAM for a pagefile which I manually configure.  I'm not a fan of "system managed" pagefiles.

Also if you have the SQL data and logs files on D:, you might put too much stress on the volume which will cause overall system slowdown.

I also thin that 8GB for SQL is enough.  The reason being is that the box is also running IIS and you don't want to squeeze system resources too much on it.  Plus you have to leave a little room for normal OS operations.

Question:  do you have the AppPool(s) set to recycle?

Hope this helps.


Author Comment

ID: 40276757
AppPool(s) recycling is left to default Regular Time Interval (minutes) 1740

Author Closing Comment

ID: 40278415
Very helpful, thanks very much

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question