[ https://issues.apache.org/jira/browse/COUCHDB-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714294#action_12714294 ] Antony Blakey commented on COUCHDB-365: --------------------------------------- The original error is in this code: should_flush(_DocCount) -> MeAndMyLinks = [self()| [P || P <- element(2,process_info(self(),links)), is_pid(P)]], case length(MeAndMyLinks)/2 > ?BUFFER_NATTACHMENTS of true -> true; false -> case memory_footprint(MeAndMyLinks) > 2*?BUFFER_MEMORY of true -> [garbage_collect(Pid) || Pid <- MeAndMyLinks], memory_footprint(MeAndMyLinks) > ?BUFFER_MEMORY; false -> false end end. The problem being that the second time memory_footprint is called the elements of MeAndMyLinks may not be valid because of the preceding garbage_collect. I fixed this by replacing that second call by this: memory_footprint([self()| [P || P <- element(2,process_info(self(),links)), is_pid(P)]]) > ?BUFFER_MEMORY; > Replication hangs and won't restart > ----------------------------------- > > Key: COUCHDB-365 > URL: https://issues.apache.org/jira/browse/COUCHDB-365 > Project: CouchDB > Issue Type: Bug > Components: Database Core > Affects Versions: 0.9.1 > Environment: Replicate to Ubuntu from OSX, both running R13B > Reporter: Antony Blakey > > Partway through a replication I get this: > {"error":"json_encode","reason":"{bad_term,{couch_rep,'-memory_footprint/1-fun-0-',2}}"} > as the response from the replication request. Attempting to restart replication results in: > [info] [<0.5511.0>] replication "1f78d088910dc73016c0b16b2fb84aac" already running at <0.4203.0> > but the replication has hung. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.