|
![](/i/fill.gif) |
>> One thing I discovered back at uni: If your Java program accidentally
>> goes into an infinite loop, it dies almost instantly with a stack
>> overflow.
>
> That's just because the VM only claims a small amount of RAM to start with...
> quite irritating actually, it took me ages to work out I had to increase its
> allocation to get my fractal plotter to be able to hold a decent image :-)
>
> (but then it was too slow anyway so I rewrote it in C)
Smalltalk seemed to be very, very good at handling large amounts of
objects in RAM. It didn't complain or anything, it just got on with it.
Unfortunately, usually the only reason for this happening was programmer
error. :-/
Haskell (or rather, GHC) is similar. It will happily eat several GB of
VM very quickly. The difficulty isn't figuring out how to allocate
enough space; it's finding the magic CLI switch that tells it to quit
rather than eat all available RAM!
(There's a switch that makes it die if the program tries to allocate
more than X. If you happen to know that your program can only possibly
require a few MB, set this switch and if there's a bug, the program will
die rather than kill you.)
Post a reply to this message
|
![](/i/fill.gif) |