couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohit Amarnath (JIRA)" <>
Subject [jira] Created: (COUCHDB-325) Memory Leak in 9.0?
Date Tue, 14 Apr 2009 13:49:14 GMT
Memory Leak in 9.0?

                 Key: COUCHDB-325
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 0.9
         Environment: gentoo linux on c1.medium aws instance
            Reporter: Rohit Amarnath
            Priority: Minor
             Fix For: 0.9

I am using couchrest to transform a document from one database to another (millions of records).
The memory usage continues to increase till all the memory is used. The process occasionally
fails, but usually completes. I dont know enough about ruby/couchrest/couchdb to be able to
tell you where the memory is increasing from - but  if you give me some direction, I will
be happy to take a look. 

If I comment out the save, it seems ok. 

Here is the code:


require 'rubygems'
require 'couchrest'

@db = CouchRest.database!("")
@db2 = CouchRest.database!("")

@streamer =
@streamer.view("_all_docs") do |row|

doc = @db.get(row["id"])

# remove id so the new database gets fresh document

# change badgerfish notation to assign $ key value to parent
doc["amounts"]["obligatedAmount"] =  doc["amounts"]["obligatedAmount"]["$"]
doc["amounts"]["baseAndAllOptionsValue"] =  doc["amounts"]["baseAndAllOptionsValue"]["$"]
doc["amounts"]["baseAndExercisedOptionsValue"] =  doc["amounts"]["baseAndExercisedOptionsValue"]["$"]

...... A whole bunch of fields

# save the document using bulk save
response =  @db2.save_doc(doc,true)

  # if streamer ends, save last few documents


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message