.Net Exception Question

  • Thread starter Thread starter David Pope
  • Start date Start date
D

David Pope

Does a handled error exception that continuously happens in a running
application consume memory over a period of time?

For example, if I have continuous loop trying to connect to website and I
get exceptions everytime, will these exceptions consume memory over time?

I hope this makes sense.

tia,

David
 
David Pope said:
Does a handled error exception that continuously happens in a running
application consume memory over a period of time?

Only if there is a bug in .NET causing a memory leak.

According to the specifications, it should not.
 
Well, only in the same way that instantiating and releasing any ol' object
would consume memory... and eventually cleaned up the garbage collector. It
shouldn't be a concern.

However, exceptions will slow your loop down... not because of a memory leak
but just because exceptions are slooooowww (for whatever reason that I don't
fully understand). A loop that takes X seconds to run may take many many
magnitudes longer if it throws and catches an exception on each loop around.
 
Back
Top