Out of memory when trying to commit

Asked by Muhammad Bashir Al-Noimi on 2011-11-21

When I tried to make a commit I got:
---
bzr: out of memory
Use -Dmem_dump to dump memory to a file.
---

How can I fix this issue?

OS: Windows 7
bzr: bzr-2.4.0-1-setup.exe

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Martin Pool
Solved:
2013-05-26
Last query:
2013-05-26
Last reply:
2012-04-20

When I tried to make a commit I got:
---
bzr: out of memory
Use -Dmem_dump to dump memory to a file.
---

How can I fix this issue?

OS: Windows 7
bzr: bzr-2.4.0-1-setup.exe

Martin Packman (gz) said : #2

Are there any very large files in the repository? Trying to version big binaries can result in this kind of problem, see bug 109114 for more. More details about the size of the repository and the changes you're trying to commit would be useful.

I already committed many revisions of some binary files the size of largest one is 250 MB but the issue occurred when I tried to commit tiny text file.

For that I'm wondering why this happen!

Martin Packman (gz) said : #4

Having it only start failing on a small commit can be surprising. What's probably happening is that the automatic repacking is triggered, and that requires memory proportional to the size of the repo. To confirm this, run `bzr pack` and see if you get the same "out of memory" error.

Unfortunately, once your repository has been bloated by big binaries, it's not easy to go back. Branching from an earlier revision then omitting them is one option, or otherwise rewriting them out of the history.

I got same error when I run `bzr pack` !!!

What's your suggestion? Do I need create a new repository?

Best Martin Pool (mbp) said : #6

This is an out-of-memory error. We are working on fixing them.

Can you please paste the traceback from .bzr.log, whose location is
shown by 'bzr --version'.

LELAK (r-sysrdmin-t) said : #7

Same problem here. Looking for help!

Thank you!

Bazaar (bzr) 2.5.0
  Python interpreter: C:\Program Files (x86)\Bazaar\python26.dll 2.6.6
  Python standard library: C:\Program Files (x86)\Bazaar\lib\library.zip
  Platform: Windows-7-6.1.7600
  bzrlib: C:\Program Files (x86)\Bazaar\lib\library.zip\bzrlib
  Bazaar configuration: C:/Users/tiago.LELAK/AppData/Roaming/bazaar/2.0
  Bazaar log file: C:\Users\tiago.LELAK\Documents\.bzr.log

Copyright 2005-2012 Canonical Ltd.
http://bazaar.canonical.com/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Bazaar is part of the GNU Project to produce a free operating system.

LELAK (r-sysrdmin-t) said : #8

BZR LOG from out of memory error:

Fri 2012-04-20 20:18:59 -0300
0.085 bazaar version: 2.5.0
0.086 bzr arguments: [u'qsubprocess', u'--bencode', u'l6:commit2:-m11:apache conf11:apache-conf34:jacobdelafonfr_2009/fr/sitemap.xml22:jacobdelafonfr_2009/ma30:jacobdelafonfr_2009/robots.txt34:apache-conf/jacobdelafon-prod.conf45:apache-conf/jacobdelafon_prod_virtualhost.txt55:apache-conf/jacobdelafonfr_2009-virtualHost-config.conf59:apache-conf/review.jacobdelafonfr2009.kohler.lelak.net.conf34:jacobdelafonfr_2009/ma/sitemap.xmle']
0.088 looking for plugins in C:/Users/tiago.LELAK/AppData/Roaming/bazaar/2.0/plugins
0.088 looking for plugins in C:/Program Files (x86)/Bazaar/plugins
0.139 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.197 bazaar version: 2.5.0
0.197 bzr arguments: [u'commit', u'-m', u'apache conf', u'apache-conf', u'jacobdelafonfr_2009/fr/sitemap.xml', u'jacobdelafonfr_2009/ma', u'jacobdelafonfr_2009/robots.txt', u'apache-conf/jacobdelafon-prod.conf', u'apache-conf/jacobdelafon_prod_virtualhost.txt', u'apache-conf/jacobdelafonfr_2009-virtualHost-config.conf', u'apache-conf/review.jacobdelafonfr2009.kohler.lelak.net.conf', u'jacobdelafonfr_2009/ma/sitemap.xml']
0.201 encoding stdout as osutils.get_user_encoding() 'cp1252'
1.368 opening working tree 'W:/kohler/jacobdelafon_fr/review'
2.191 preparing to commit
[10224] 2012-04-20 20:19:02.865 INFO: Committing to: bzr+http://bzr.lelak.net/kohler/jacobdelafon_fr/dev/
3.754 Selecting files for commit with filter [u'apache-conf', u'jacobdelafonfr_2009/fr/sitemap.xml', u'jacobdelafonfr_2009/ma', u'jacobdelafonfr_2009/robots.txt']
[10224] 2012-04-20 20:19:04.717 INFO: added jacobdelafonfr_2009/ma
[10224] 2012-04-20 20:19:04.719 INFO: added jacobdelafonfr_2009/ma/sitemap.xml
[10224] 2012-04-20 20:19:04.720 INFO: added jacobdelafonfr_2009/fr/sitemap.xml
[10224] 2012-04-20 20:19:04.720 INFO: added jacobdelafonfr_2009/robots.txt
[10224] 2012-04-20 20:19:04.720 INFO: added apache-conf
[10224] 2012-04-20 20:19:04.721 INFO: added apache-conf/jacobdelafon-prod.conf
[10224] 2012-04-20 20:19:04.721 INFO: added apache-conf/jacobdelafon_prod_virtualhost.txt
[10224] 2012-04-20 20:19:04.721 INFO: added apache-conf/jacobdelafonfr_2009-virtualHost-config.conf
[10224] 2012-04-20 20:19:04.723 INFO: added apache-conf/review.jacobdelafonfr2009.kohler.lelak.net.conf
25.876 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('bzr+http://bzr.lelak.net/.bzr/repository/')), which has 27 pack files, containing 6750 revisions. Packing 10 files into 1 affecting 10 revisions
26.122 repacking 10 revisions
27.443 repacking 10 inventories
28.980 repacking chk: 10 id_to_entry roots, 8 p_id_map roots, 836 total keys
92.200 repacking 5821 texts
119.500 Adding the key (<bzrlib.btree_index.BTreeGraphIndex object at 0x0318F3B0>, 14921278, 6784788) to an LRUSizeCache failed. value 455525082 is too big to fit in a the cache with size 41943040 52428800
121.019 aborting commit write group because of exception:
121.019 Traceback (most recent call last):
  File "bzrlib\commit.pyo", line 447, in _commit
  File "bzrlib\vf_repository.pyo", line 211, in commit
  File "bzrlib\remote.pyo", line 1254, in commit_write_group
  File "bzrlib\repository.pyo", line 633, in commit_write_group
  File "bzrlib\repofmt\pack_repo.pyo", line 1727, in _commit_write_group
  File "bzrlib\repofmt\pack_repo.pyo", line 1629, in _commit_write_group
  File "bzrlib\repofmt\pack_repo.pyo", line 888, in autopack
  File "bzrlib\repofmt\pack_repo.pyo", line 928, in _do_autopack
  File "bzrlib\repofmt\pack_repo.pyo", line 947, in _execute_pack_operations
  File "bzrlib\repofmt\pack_repo.pyo", line 716, in pack
  File "bzrlib\repofmt\groupcompress_repo.pyo", line 493, in _create_pack_from_packs
  File "bzrlib\repofmt\groupcompress_repo.pyo", line 476, in _copy_text_texts
  File "bzrlib\repofmt\groupcompress_repo.pyo", line 405, in _copy_stream
  File "bzrlib\groupcompress.pyo", line 1784, in _insert_record_stream
  File "bzrlib\groupcompress.pyo", line 456, in get_bytes_as
  File "bzrlib\groupcompress.pyo", line 276, in extract
MemoryError

Thanks Martin Pool, that solved my question.