Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-888

out of memory crash when compacting document with lots of edit branches

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.2, 1.1
    • Database Core
    • None
    • Committers Level (Medium to Hard)

    Description

      I have a database which will crash CouchDB if I try to compact it. It causes beam.smp to use all the memory on the server. I caught it in the act one time and sorted the Erlang processes by memory usage. The process spawned to do the compaction turned out to be the culprit. I took a backtrace of the process and found that it was mapping a very large revision tree. I have reason to believe that the document has a large number (~1000s) of edit conflicts.

      I think part of the problem may be that the recursion in couch_key_tree:map_simple requires each stack space for every iteration. I'm not sure if it's possible to rewrite the algorithm in a more memory-friendly way given the current tree structure.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kocolosk Adam Kocoloski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: