Re: .Net Exceptions

From: cody (please_dont.spam.deutronium_at_gmx.de)
Date: 09/19/04


Date: Sun, 19 Sep 2004 15:37:48 +0200


>> Why should user data die if a coponent which has nothing to do with you
>> user
>> data throws an Exception?
>> Maybe it is a visualisation component which throws an Exception for
>> example
>> if a number is too large or another specific condition and they never
>> tested
>> such a condition.

> The error may also be fatal and crash your application at a later point in
> time (thus disrupting data). Example: All managed code allocates memory
from
> the managed heap. An OutOfMemoryException even in a non-essential part of
> your application is a problem you cannot simply ignore.

Did you read my example with the soundcomponent? If it tries to allocate a
too large soundbuffer, an OutOfMemoryException will occur. But why should
the rest of my application care about that? Since the request to allocate
the large soundbuffer failed, we have still enough memory. We have no
background music playing but we are far far away from trouble.

> You may be right in guessing that's a stupid little bug in that component.
You may be wrong,

And if Iam wrong then the App crashes when there is really a problem which
affects vital parts of my app, but in most cases this is not the case.

cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk



Relevant Pages

  • Re: Technical two dimensional array question
    ... > Does it allocate a contiguous blocks of memory or not? ... What it allocates is memory space for *references* to string objects, ... > I tried it and I get an exception error, as I should, but, ... allocated array. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Non-failure guarantied malloc/new
    ... >> error code to the caller to inform that something went wrong. ... After all I can recieve such a exception at any time so I will have no ... > You could allocate all needed memory in static blocks. ...
    (comp.lang.cpp)
  • RE: StackOverflowException
    ... I think I've discovered what's causing it, although I don't really know what ... It seems that the call to new I'm using to allocate the array is what is ... locktable is null when I'm attempting to allocate my unmanaged array. ... > which throws the exception. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: throwing out of memory exception in c++ doesnt work
    ... > If you've got a reasonably healthy quantity of virtual memory available, ... > bit and add some exception handling: ... > allocate before the thrashing commences and try to keep track of what ... thrown, when allocating the array of ints, but I am trying to allocate a ...
    (comp.lang.cpp)