Code review comment for lp:~mbp/bzr/109115-memoryerror-message

Revision history for this message
Martin Pool (mbp) wrote :

This adds MemoryError as a special class of error, so Bazaar just says "bzr: out of memory" and logs a traceback to .bzr.log.

There are some cases where we use more memory than we should and obviously we want to fix them. But until they're fixed, and even after everything possible has been done, it'll still be possible to exhaust the machine's memory.

At the moment we get a lot of slightly-confused-looking bug reports about MemoryError. The goal of this change is that:

 * users may realize "oh, I don't really want to commit that 800MB ISO" and be more able to understand and work around whatever hardware or software limits we do have
 * if the limit is unreasonable, they will report a clearer bug about it, or find an existing dupe

This does mean we'll need to ask for a traceback from .bzr.log. I think that's ok.

Maybe we should eventually give an apport traceback but with a customized message.

This is not a high priority but I think it's safe for 2.0.

It's actually a bit hard to make this fail realistically. I got it to happen with

ulimit -v 80000

(ie vm size 80MB) and then diffing a large file. Getting Python etc going takes severals 10s of MB of vm.

« Back to merge proposal