{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-beam/pulls/comments/93716902","pull_request_review_id":14250715,"id":93716902,"diff_hunk":"@@ -189,11 +189,22 @@ def dumps(o):\n     s = dill.dumps(o)\n   finally:\n     dill.dill._trace(False)  # pylint: disable=protected-access\n-  return base64.b64encode(zlib.compress(s))\n+\n+  # Compress as compactly as possible to decrease peak memory usage (of multiple\n+  # in-memory copies). Also use a separate statement in order to decrease peak\n+  # memory usage (by allowing unneeded data to go out of scope).\n+  s = zlib.compress(s, 9)","path":"sdks/python/apache_beam/internal/pickler.py","position":null,"original_position":9,"commit_id":"450c11775e7b6b16cae0afead794f2e2fa6a1579","original_commit_id":"cb5e9a71e3d91e7d6faec0e5c990d4bf5d48a628","user":{"login":"katsiapis","id":22107882,"avatar_url":"https://avatars.githubusercontent.com/u/22107882?v=3","gravatar_id":"","url":"https://api.github.com/users/katsiapis","html_url":"https://github.com/katsiapis","followers_url":"https://api.github.com/users/katsiapis/followers","following_url":"https://api.github.com/users/katsiapis/following{/other_user}","gists_url":"https://api.github.com/users/katsiapis/gists{/gist_id}","starred_url":"https://api.github.com/users/katsiapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsiapis/subscriptions","organizations_url":"https://api.github.com/users/katsiapis/orgs","repos_url":"https://api.github.com/users/katsiapis/repos","events_url":"https://api.github.com/users/katsiapis/events{/privacy}","received_events_url":"https://api.github.com/users/katsiapis/received_events","type":"User","site_admin":false},"body":"Done (using the del suggestion).\r\n\r\nIn principle this could be done in a streaming manner, but I think for both cases the majority of the memory is the uncompressed object (and similarly for the b64 stuff).\r\n\r\nFurthermore, according to the comments at the top of the file this should be used for functions and modules (as opposed to data) so presumably overheads are not ridiculously large?\r\n","created_at":"2016-12-23T00:08:58Z","updated_at":"2016-12-23T00:08:58Z","html_url":"https://github.com/apache/incubator-beam/pull/1672#discussion_r93716902","pull_request_url":"https://api.github.com/repos/apache/incubator-beam/pulls/1672","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-beam/pulls/comments/93716902"},"html":{"href":"https://github.com/apache/incubator-beam/pull/1672#discussion_r93716902"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-beam/pulls/1672"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-beam/pulls/1672","id":98866229,"html_url":"https://github.com/apache/incubator-beam/pull/1672","diff_url":"https://github.com/apache/incubator-beam/pull/1672.diff","patch_url":"https://github.com/apache/incubator-beam/pull/1672.patch","issue_url":"https://api.github.com/repos/apache/incubator-beam/issues/1672","number":1672,"state":"open","locked":false,"title":"[BEAM-625] Peak memory reduction in Avro and Pickler.","user":{"login":"katsiapis","id":22107882,"avatar_url":"https://avatars.githubusercontent.com/u/22107882?v=3","gravatar_id":"","url":"https://api.github.com/users/katsiapis","html_url":"https://github.com/katsiapis","followers_url":"https://api.github.com/users/katsiapis/followers","following_url":"https://api.github.com/users/katsiapis/following{/other_user}","gists_url":"https://api.github.com/users/katsiapis/gists{/gist_id}","starred_url":"https://api.github.com/users/katsiapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsiapis/subscriptions","organizations_url":"https://api.github.com/users/katsiapis/orgs","repos_url":"https://api.github.com/users/katsiapis/repos","events_url":"https://api.github.com/users/katsiapis/events{/privacy}","received_events_url":"https://api.github.com/users/katsiapis/received_events","type":"User","site_admin":false},"body":"Decreasing the number of copies of things in scope for reduced peak memory utilization in Avro and Pickler.","created_at":"2016-12-21T03:29:37Z","updated_at":"2016-12-23T00:08:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7e39596c57da9ed51a416d48b420f294542966d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-beam/pulls/1672/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-beam/pulls/1672/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-beam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-beam/issues/1672/comments","statuses_url":"https://api.github.com/repos/apache/incubator-beam/statuses/450c11775e7b6b16cae0afead794f2e2fa6a1579","head":{"label":"katsiapis:memory","ref":"memory","sha":"450c11775e7b6b16cae0afead794f2e2fa6a1579","user":{"login":"katsiapis","id":22107882,"avatar_url":"https://avatars.githubusercontent.com/u/22107882?v=3","gravatar_id":"","url":"https://api.github.com/users/katsiapis","html_url":"https://github.com/katsiapis","followers_url":"https://api.github.com/users/katsiapis/followers","following_url":"https://api.github.com/users/katsiapis/following{/other_user}","gists_url":"https://api.github.com/users/katsiapis/gists{/gist_id}","starred_url":"https://api.github.com/users/katsiapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsiapis/subscriptions","organizations_url":"https://api.github.com/users/katsiapis/orgs","repos_url":"https://api.github.com/users/katsiapis/repos","events_url":"https://api.github.com/users/katsiapis/events{/privacy}","received_events_url":"https://api.github.com/users/katsiapis/received_events","type":"User","site_admin":false},"repo":{"id":67836035,"name":"incubator-beam","full_name":"katsiapis/incubator-beam","owner":{"login":"katsiapis","id":22107882,"avatar_url":"https://avatars.githubusercontent.com/u/22107882?v=3","gravatar_id":"","url":"https://api.github.com/users/katsiapis","html_url":"https://github.com/katsiapis","followers_url":"https://api.github.com/users/katsiapis/followers","following_url":"https://api.github.com/users/katsiapis/following{/other_user}","gists_url":"https://api.github.com/users/katsiapis/gists{/gist_id}","starred_url":"https://api.github.com/users/katsiapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsiapis/subscriptions","organizations_url":"https://api.github.com/users/katsiapis/orgs","repos_url":"https://api.github.com/users/katsiapis/repos","events_url":"https://api.github.com/users/katsiapis/events{/privacy}","received_events_url":"https://api.github.com/users/katsiapis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/katsiapis/incubator-beam","description":"Mirror of Apache Beam (Incubating)","fork":true,"url":"https://api.github.com/repos/katsiapis/incubator-beam","forks_url":"https://api.github.com/repos/katsiapis/incubator-beam/forks","keys_url":"https://api.github.com/repos/katsiapis/incubator-beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katsiapis/incubator-beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katsiapis/incubator-beam/teams","hooks_url":"https://api.github.com/repos/katsiapis/incubator-beam/hooks","issue_events_url":"https://api.github.com/repos/katsiapis/incubator-beam/issues/events{/number}","events_url":"https://api.github.com/repos/katsiapis/incubator-beam/events","assignees_url":"https://api.github.com/repos/katsiapis/incubator-beam/assignees{/user}","branches_url":"https://api.github.com/repos/katsiapis/incubator-beam/branches{/branch}","tags_url":"https://api.github.com/repos/katsiapis/incubator-beam/tags","blobs_url":"https://api.github.com/repos/katsiapis/incubator-beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katsiapis/incubator-beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katsiapis/incubator-beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/katsiapis/incubator-beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katsiapis/incubator-beam/statuses/{sha}","languages_url":"https://api.github.com/repos/katsiapis/incubator-beam/languages","stargazers_url":"https://api.github.com/repos/katsiapis/incubator-beam/stargazers","contributors_url":"https://api.github.com/repos/katsiapis/incubator-beam/contributors","subscribers_url":"https://api.github.com/repos/katsiapis/incubator-beam/subscribers","subscription_url":"https://api.github.com/repos/katsiapis/incubator-beam/subscription","commits_url":"https://api.github.com/repos/katsiapis/incubator-beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/katsiapis/incubator-beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/katsiapis/incubator-beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/katsiapis/incubator-beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/katsiapis/incubator-beam/contents/{+path}","compare_url":"https://api.github.com/repos/katsiapis/incubator-beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katsiapis/incubator-beam/merges","archive_url":"https://api.github.com/repos/katsiapis/incubator-beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katsiapis/incubator-beam/downloads","issues_url":"https://api.github.com/repos/katsiapis/incubator-beam/issues{/number}","pulls_url":"https://api.github.com/repos/katsiapis/incubator-beam/pulls{/number}","milestones_url":"https://api.github.com/repos/katsiapis/incubator-beam/milestones{/number}","notifications_url":"https://api.github.com/repos/katsiapis/incubator-beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katsiapis/incubator-beam/labels{/name}","releases_url":"https://api.github.com/repos/katsiapis/incubator-beam/releases{/id}","deployments_url":"https://api.github.com/repos/katsiapis/incubator-beam/deployments","created_at":"2016-09-09T22:14:18Z","updated_at":"2016-09-09T22:14:23Z","pushed_at":"2016-12-23T00:03:40Z","git_url":"git://github.com/katsiapis/incubator-beam.git","ssh_url":"git@github.com:katsiapis/incubator-beam.git","clone_url":"https://github.com/katsiapis/incubator-beam.git","svn_url":"https://github.com/katsiapis/incubator-beam","homepage":null,"size":24091,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:python-sdk","ref":"python-sdk","sha":"3b4fd5c7d962987405dc157e6b84788af61f6413","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":50904245,"name":"incubator-beam","full_name":"apache/incubator-beam","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-beam","description":"Mirror of Apache Beam (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-beam","forks_url":"https://api.github.com/repos/apache/incubator-beam/forks","keys_url":"https://api.github.com/repos/apache/incubator-beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-beam/teams","hooks_url":"https://api.github.com/repos/apache/incubator-beam/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-beam/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-beam/events","assignees_url":"https://api.github.com/repos/apache/incubator-beam/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-beam/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-beam/tags","blobs_url":"https://api.github.com/repos/apache/incubator-beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-beam/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-beam/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-beam/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-beam/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-beam/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-beam/subscription","commits_url":"https://api.github.com/repos/apache/incubator-beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-beam/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-beam/merges","archive_url":"https://api.github.com/repos/apache/incubator-beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-beam/downloads","issues_url":"https://api.github.com/repos/apache/incubator-beam/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-beam/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-beam/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-beam/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-beam/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-beam/deployments","created_at":"2016-02-02T08:00:06Z","updated_at":"2016-12-23T00:03:53Z","pushed_at":"2016-12-23T00:03:42Z","git_url":"git://github.com/apache/incubator-beam.git","ssh_url":"git@github.com:apache/incubator-beam.git","clone_url":"https://github.com/apache/incubator-beam.git","svn_url":"https://github.com/apache/incubator-beam","homepage":null,"size":25626,"stargazers_count":542,"watchers_count":542,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":326,"mirror_url":"git://git.apache.org/incubator-beam.git","open_issues_count":60,"forks":326,"open_issues":60,"watchers":542,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-beam/pulls/1672"},"html":{"href":"https://github.com/apache/incubator-beam/pull/1672"},"issue":{"href":"https://api.github.com/repos/apache/incubator-beam/issues/1672"},"comments":{"href":"https://api.github.com/repos/apache/incubator-beam/issues/1672/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-beam/pulls/1672/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-beam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-beam/pulls/1672/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-beam/statuses/450c11775e7b6b16cae0afead794f2e2fa6a1579"}}}}
{"actor":{"display_login":"katsiapis"}}