Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1087703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:58:23+00:00 2026-05-16T22:58:23+00:00

This is a theoretical question more than anything else. In the case of C#

  • 0

This is a theoretical question more than anything else. In the case of C# and .NET, if an .aspx or .ascx script dies due to an unhandled exception, would you normally expect its memory to be released, or is that not a sure thing? In other words, can an unhandled exception itself leak memory?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:58:23+00:00Added an answer on May 16, 2026 at 10:58 pm

    What is a “memory leak”? In manually managed environments we say that unreferenced allocations are a leak. By this definition, there are no leaks in a GC environment.

    However, there are a few scenarios that have the same effect:

    Stale References

    // create temporary item
    Item item = new Item();
    
    // add it to the global map, so Processor::Fetch finds it by ID
    itemMap.Add(item.id, item);
    Process(item.id);
    
    // remove from cache
    itemMap.Remove(item.id);
    

    If Process() throws, the item remains referenced in itemMap. Unless you regulary throw out the entire map (or you made the wise decision to use weak pointers for the map), the item map will accumulate and hold references to temporaries, blocking memory.

    Unmanaged resources

    Imagine you have a small managed object that allocates large unmanaged resources, and does not implement IDisposable, or IDisposable isn’t used.

    These objects might live long enough to get pushed to Gen 2. If there’s no other pressure on the managed heap, a Gen 2 collection might never run. You may end up pushing tiny objects into Gen 2 until the unmanaged resources exhaust your memory.

    This scenario might sound silly, but that’s exactly how COM Interop works (and I have a case ID to prove it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is more of a theoretical question than anything. I have 3 dictionaries that
This is more of a theoretical question than an actual problem I have. If
This is more a theoretical question than a practical one, but given I undestand
This is more of a theoretical question than code: What i did till now
This is more of a theoretical question rather than language specific, but I'm mostly
This is more of a theoretical question than a specific one. I have a
This is a more theoretical question about macros (I think). I know macros take
this is more a theoretical question i asked myself. I remembered that BinarySearch of
It's more a theoretical question than a practical one. I know that GC are
My apologies for a more theoretical question, though I suppose this is more of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.