You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Robert Newson (JIRA)" <ji...@apache.org> on 2010/11/25 14:39:14 UTC

[jira] Commented: (COUCHDB-964) Large memory usage downloading attachments

    [ https://issues.apache.org/jira/browse/COUCHDB-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935752#action_12935752 ] 

Robert Newson commented on COUCHDB-964:
---------------------------------------


I've run this test on OS X (10.6.5) and cannot reproduce the problem. the RSIZE of beam.smp remains at 180 mb throughout the test and drops to 40 mb on completion.

CouchDB does not buffer the whole attachment into memory. It could be that Erlang's GC is unable to keep up on your hardware and therefore the unreferenced chunks of the attachment are still retained in memory.

> Large memory usage downloading attachments
> ------------------------------------------
>
>                 Key: COUCHDB-964
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-964
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 1.0.1
>         Environment: Linux, Erlang R14B
>            Reporter: David Orrell
>
> When downloading a large attachment the CouchDB process appears to load the entire attachment in memory before data is sent to the client. I have a 1.5 GB attachment and the CouchDB process grows by approximately this amount per client connection.
> For example (as reported by Bram Nejit):
> dd if=/dev/urandom of=/tmp/test.bin count=50000 bs=10240
> Put test.bin as an attachment in a coucdb database
> Run
> for i in {0..50};do curl http://localhost:5984/[test
> database]/[doc_id]/test.bin > /dev/null 2>&1 & done
> This will create 50 curl processes which download from your couchdb. Looking at the memory consumption of couchdb, it seems like it is loading large parts of the file into memory.

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