Change the name of ArrayBoundsException in druntime

Robert Fraser fraserofthenight at gmail.com
Fri Oct 24 16:04:53 PDT 2008


Bill Baxter wrote:
> On Fri, Oct 24, 2008 at 10:42 AM, Robert Fraser
> <fraserofthenight at gmail.com> wrote:
>> Sean Kelly wrote:
>>> Perhaps I'm simply getting old... when did memory use become irrelevant?
>>>  I grant that making an application exception safe is more difficult if out
>>> of memory conditions are considered recoverable, but I don't think it's
>>> tremendously more difficult.
>> I'm currently studying Computer Engineering at university. I don't think a
>> single programming course I've taken has _mentioned_ running out of memory
>> (next quarter I'm taking Operating Systems, so hopefully that will). One
>> class mentioned memory complexity as a side issue, but never got into it.
>> Even at work, I've never been asked to think about it.
> 
> People do still develop for embedded devices with small memory and/or
> no virtual memory.
> I'm pretty sure it's still a serious concern if you live in that world.
> 
> --bb

I'm not saying it doesn't come up in practice; I'm saying developers are 
trained not to think about it in most cases. And programming to handle a 
small amount of memory is a different problem than programming to 
gracefully fail when the program runs out of memory (for example, my 
program might only use 10k of RAM... but if that 10k isn't there, it 
might just crash with an error message).

The problem with an OutOfMemoryError being treated as an Exception is 
that if there are many catch(Exception) blocks, an out-of-memory error 
will propagate logic bugs across the program (since no one is cleaning 
up the memory, most allocations will fail). So instead of a nice, clean 
error, the suer will experience weird and frustrating behavior that 
doesn't mention memory at all.



More information about the Digitalmars-d mailing list