What do you do when malloc returns 0 or new throws exception? Just halt or try to survive OOM condition/save the user's work? 
Do you handle Out-Of-Memory conditions?
programming practices;exceptions
I'd avoid the OOM like avoiding a crash.Avoid doing huge chunk of work (and allocate huge chunk of memory) at once. Keep the data on the disk, trust the OS disk cache and make use of memory-mapped IO as much as possible, and only operate on a small part of data at a time. If large amounts of data need to be on-line (served with low latency) then keep them in the memory across several machines, like all the big search engine companies do. Or buy a SSD.