What is causing Resourse-Exhaustion-Detector Event in app

Posted on 2014-08-20
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 (
    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
    LVL 25

    Expert Comment

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

    Author Comment

    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

    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.
    LVL 25

    Expert Comment

    by:Dan McFadden
    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:

    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

    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 25

    Accepted Solution

    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

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

    Author Closing Comment

    Very helpful, thanks very much

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Introduction (All good things must come to an end ( The original MySQL API ( has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all curre…
    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    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.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now