Animated gifs are so uncommon anyway (the use cases I've seen where it falls down are lolcat-worthy animations) that it's probably not worth fixing. The 90s-era gif animations probably look good enough.
According to the Android developer in comment 42 the explanation is that Android has multitasking while the iPhone doesn't.
function readGIF(filename) {
if (calcMemSizeNeeded(filename) > memoryFree()) {
displayGifPlaceholder();
}
}
eg just display an animated GIF if there's enough ram, and if not, display some placeholder.I guess one of the other issues there though is websites that 'stream' animated gifs that never end. Still, you could just disable those for now.
Seriously, google "OOM killer." This problem, and problems like it, are not new, nor are they simple to solve.
Also, I'm not sure where did commenter #45 get the idea about multitasking. #42 said just that process which is memory-hungry will be killed. That's it. It doesn't matter if the OS is multitasking or not... Maemo is multitasking (linux based) and displays animated GIFs just fine.