{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/6502","repository_url":"https://api.github.com/repos/pouchdb/pouchdb","labels_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/6502/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/6502/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/6502/events","html_url":"https://github.com/pouchdb/pouchdb/issues/6502","id":228695160,"number":6502,"title":"changes() leaks memory","user":{"login":"cztomsik","id":3526922,"avatar_url":"https://avatars0.githubusercontent.com/u/3526922?v=3","gravatar_id":"","url":"https://api.github.com/users/cztomsik","html_url":"https://github.com/cztomsik","followers_url":"https://api.github.com/users/cztomsik/followers","following_url":"https://api.github.com/users/cztomsik/following{/other_user}","gists_url":"https://api.github.com/users/cztomsik/gists{/gist_id}","starred_url":"https://api.github.com/users/cztomsik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cztomsik/subscriptions","organizations_url":"https://api.github.com/users/cztomsik/orgs","repos_url":"https://api.github.com/users/cztomsik/repos","events_url":"https://api.github.com/users/cztomsik/events{/privacy}","received_events_url":"https://api.github.com/users/cztomsik/received_events","type":"User","site_admin":false},"labels":[{"id":543319142,"url":"https://api.github.com/repos/pouchdb/pouchdb/labels/needs%20investigation","name":"needs investigation","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-15T12:15:03Z","updated_at":"2017-05-22T08:26:42Z","closed_at":null,"body":"Any `changes()` call without `return_docs: false` leaks memory\r\n\r\nIt seems that `return_docs` is effective even for http connections unlike from what is mentioned in the docs:\r\n> Is available for non-http databases and defaults to true\r\n\r\n### Reproduce\r\n```\r\nconst db = new PouchDB('http://127.0.0.1:5984/skimdb')\r\n\r\ndb.changes({\r\n  include_docs: true,\r\n  batch_size: 1000\r\n}).on('change', (c) => {\r\n  // doesnt matter\r\n})\r\n```\r\n\r\nWhat happens is that it will \"slow down\" after first ~50 000 seqs - because of excessive memory usage (few seconds and it's hundreds MBs). I am not sure if it relates to any existing issue so I am creating new one.\r\n\r\nThis might be resolved by:\r\n1. updating docs (along with examples)\r\n2. making `return_docs: false` default for http databases"},"comment":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/comments/303033367","html_url":"https://github.com/pouchdb/pouchdb/issues/6502#issuecomment-303033367","issue_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/6502","id":303033367,"user":{"login":"vvo","id":123822,"avatar_url":"https://avatars3.githubusercontent.com/u/123822?v=3","gravatar_id":"","url":"https://api.github.com/users/vvo","html_url":"https://github.com/vvo","followers_url":"https://api.github.com/users/vvo/followers","following_url":"https://api.github.com/users/vvo/following{/other_user}","gists_url":"https://api.github.com/users/vvo/gists{/gist_id}","starred_url":"https://api.github.com/users/vvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvo/subscriptions","organizations_url":"https://api.github.com/users/vvo/orgs","repos_url":"https://api.github.com/users/vvo/repos","events_url":"https://api.github.com/users/vvo/events{/privacy}","received_events_url":"https://api.github.com/users/vvo/received_events","type":"User","site_admin":false},"created_at":"2017-05-22T08:26:42Z","updated_at":"2017-05-22T08:26:42Z","body":"@willholley If you need more insights let us know, for now this is mostly a documentation issue. The doc says that if you are only using a http layer or DB then you are fine, changes will not leak. But that's not the case because the actual http pouchdb layer sets returnDocs: true by default."}}
{"actor":{"display_login":"vvo"}}