Merge lp:~kbielefe/bzr/551391-log-memory-usage into lp:bzr
Proposed by
Karl Bielefeldt
Status: | Merged |
---|---|
Approved by: | Vincent Ladeuil |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5484 |
Proposed branch: | lp:~kbielefe/bzr/551391-log-memory-usage |
Merge into: | lp:bzr |
Diff against target: |
106 lines (+41/-1) 4 files modified
NEWS (+4/-0) bzrlib/help_topics/en/debug-flags.txt (+1/-0) bzrlib/tests/test_trace.py (+12/-1) bzrlib/trace.py (+24/-0) |
To merge this branch: | bzr merge lp:~kbielefe/bzr/551391-log-memory-usage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Needs Information | ||
Martin Pool | Needs Fixing | ||
John A Meinel | Needs Fixing | ||
Review via email: mp+37086@code.launchpad.net |
Commit message
Dump memory profile to log if -Dmem_dump is set.
Description of the change
Implements bug 551391 by using meliae to dump all memory to a file in the current directory when there is a MemoryError exception. Gracefully exits if meliae is not installed or if there isn't enough memory to perform the dump or other exceptions occur during the dump. Logs whether it succeeded or not to ~/.bzr.log.
Test using ulimit -m and ulimit -v to set memory relatively low and run something that can potentially use a lot of memory such as bzr check.
To post a comment you must log in.
We should probably have a flag to enable/disable this. "-Ddump_memory" comes to mind. I don't know which should be the default, sort of like core-dumping. I think the default for most people is to have it off, so I would probably go with that. So we could change the error message to mention "use -Dmemory_dump to get a memory dump" (or whatever).
I like the idea, the code seems fine otherwise.