We help IT Professionals succeed at work.

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

210 Views
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
        Try
            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;"
            cn.Open()
            Dim cmd As New SqlCommand
            cmd.Connection = cn
            cmd.CommandType = CommandType.Text
            cmd.CommandText = strSQL
            Try
                cmd.ExecuteNonQuery()
            Catch
            End Try
            cn.Close()
            cn.Dispose()
            cn = Nothing
            Response.Redirect("blank.gif")

        Catch
        End Try
    End Sub
Comment
Watch Question

Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
Are there any errors or warnings in the Event Logs?

Author

Commented:
Yes,
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

Commented:
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.
Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
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

Commented:
Answers:
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
Technical Lead - Active Directory
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

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

Author

Commented:
Very helpful, thanks very much

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.