C interview question

0 votes

I need assistance with an interview question.

You have the following code-behind class in ASP.NET:

public partial class Page1 : Page 
{
    private string _value;

    public Page1() 
    {
        if (DateTime.Now.Ticks % 10 == 0)
            _value = "Test";
    }       

    ~Page1() 
    {
        if(_value.Equals("Test"))
            _value = string.Empty;      
    }
}

The w3wp.exe process stops unexpectedly every time someone requests this page.

  1. Why does this happen instead of the user seeing the yellow screen of death (ASP.NET's default error page)?
  2. Why does the managed heap always have an OutOfMemoryException?
Jun 11, 2022 in C# by krishna
• 2,820 points

edited 4 days ago 5 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP