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

  • SEARCH
  • Home
  • 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 1068653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:18:53+00:00 2026-05-16T20:18:53+00:00

I am really interested to know that, Is it possible that using try …

  • 0

I am really interested to know that, Is it possible that using try … catch mechanism, we can avoid memory crash of our application … ??

Let say the program part that we are expecting a chance of memory leak is kept under try…catch block, if the program crashes (ie memory leak) occurs then catch statement execute. So we can prevent our program from being crashed.

Is it possible ? If yes, How Or If not , why not ??

  • 1 1 Answer
  • 0 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-16T20:18:54+00:00Added an answer on May 16, 2026 at 8:18 pm

    A try/catch block is there to catch an exception and stop it from propagating upwards in your callstack.

    The idea goes that you catch it at the place where you know how to handle it, and then you get a chance to execute code in response to the exception.

    It is not a magical solution that will prevent anything, it is just what I said above. What you do with the exception is what matters.

    And a memory leak and a crash is not the same thing, it is rare that a program crashes due to memory leaks, unless it actually runs out of memory. A memory leak is rarely “fixable” after the fact. The correct, and usually only, way to fix a memory leak is to avoid it happening in the first place.

    Also, yes, in a way you can keep your program from crashing by adding try/catch blocks all over, but the only thing you’ve succeeded in is to hide the crash from the user, and then let the program continue running. “Crashes” are not always safe to ignore, or rather, they are usually not safe to ignore.

    If you are looking for some catch-all advice on how to avoid a program crashing, here’s my advice:

    • Write a program that works correctly

    I think we need to know more about what kinds of problems you’re having, or you need to post a clearer question.

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

Sidebar

Related Questions

Im feeling crazy and I've decided I would really like to write a User-Defined
I have a pointer to a COM object that implements an undocumented interface. I
I've got a 2.0 server control that uses a dynamic query roughly in the
Let's assume that I have a complex hash reference $hash_ref , and I would
I have a client that gave me a .psd file that contains the entire
First off, The Problem: We have a Web App with a Flash front-end that
In a low level language (C, C++ or whatever): I have the choice in
I have an ASP.NET web application and I'm thinking about the following: before sending
I am studying Forth for a personal project I have on my mind. It

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.