{"action":"opened","issue":{"url":"https://api.github.com/repos/medic/medic-analytics/issues/22","labels_url":"https://api.github.com/repos/medic/medic-analytics/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-analytics/issues/22/comments","events_url":"https://api.github.com/repos/medic/medic-analytics/issues/22/events","html_url":"https://github.com/medic/medic-analytics/issues/22","id":130564993,"number":22,"title":"difficulty dealing with multi-megabyte doc sizes","user":{"login":"btbonval","id":880439,"avatar_url":"https://avatars.githubusercontent.com/u/880439?v=3","gravatar_id":"","url":"https://api.github.com/users/btbonval","html_url":"https://github.com/btbonval","followers_url":"https://api.github.com/users/btbonval/followers","following_url":"https://api.github.com/users/btbonval/following{/other_user}","gists_url":"https://api.github.com/users/btbonval/gists{/gist_id}","starred_url":"https://api.github.com/users/btbonval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btbonval/subscriptions","organizations_url":"https://api.github.com/users/btbonval/orgs","repos_url":"https://api.github.com/users/btbonval/repos","events_url":"https://api.github.com/users/btbonval/events{/privacy}","received_events_url":"https://api.github.com/users/btbonval/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-02T03:50:11Z","updated_at":"2016-02-02T03:50:11Z","closed_at":null,"body":"The adapter quickly hits out-of-memory errors when dealing with a very large doc.\r\n\r\nInternally, it is reporting to have 600some MiB available on my machine (`process.memoryUsage()`).\r\n\r\nExternally I've seen it get to 13% memory, which is a little over 2 GiB on my machine.\r\n\r\nIt experiences out of memory most obviously during `couchiter.insertListIntoPG()`:\r\nhttps://github.com/medic/medic-analytics/blob/738d4767af87012fb757936eb7ca92610d85c6ad/couchiter.js#L51-L65\r\n\r\nabove was determined here: https://github.com/medic/medic-projects/issues/88#issuecomment-178320657"}}