From dev-return-13831-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Tue Dec 14 20:34:26 2010 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 59881 invoked from network); 14 Dec 2010 20:34:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Dec 2010 20:34:26 -0000 Received: (qmail 3429 invoked by uid 500); 14 Dec 2010 20:34:25 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 3395 invoked by uid 500); 14 Dec 2010 20:34:25 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 3385 invoked by uid 99); 14 Dec 2010 20:34:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Dec 2010 20:34:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Dec 2010 20:34:22 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBEKY1SF025552 for ; Tue, 14 Dec 2010 20:34:01 GMT Message-ID: <15144902.120911292358841024.JavaMail.jira@thor> Date: Tue, 14 Dec 2010 15:34:01 -0500 (EST) From: "Adam Kocoloski (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Closed: (COUCHDB-888) out of memory crash when compacting document with lots of edit branches MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adam Kocoloski closed COUCHDB-888. ---------------------------------- Resolution: Fixed Assignee: (was: Damien Katz) Committed the appropriate versions of this patch to 1.0.x, 1.1.x, and trunk. > out of memory crash when compacting document with lots of edit branches > ----------------------------------------------------------------------- > > Key: COUCHDB-888 > URL: https://issues.apache.org/jira/browse/COUCHDB-888 > Project: CouchDB > Issue Type: Bug > Components: Database Core > Reporter: Adam Kocoloski > Fix For: 1.0.2, 1.1 > > Attachments: 0001-fix-OOME-when-compacting-a-DB-with-many-edit-conflic-v2.patch, 0001-fix-OOME-when-compacting-a-DB-with-many-edit-conflic.patch, key_tree_backtrace.txt.gz > > > 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.