{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/presto/pulls/comments/44335366","id":44335366,"diff_hunk":"@@ -173,7 +176,15 @@ public final boolean isFinished()\n             finishing = true;\n         }\n \n-        return finishing && pageBuilder.isEmpty();\n+        if (!finishing || !pageBuilder.isEmpty()) {\n+            return false;\n+        }\n+\n+        operatorContext.getSystemMemoryTracker().freeMemory(recordedPageBuilderMemoryUsage);","path":"presto-main/src/main/java/com/facebook/presto/operator/ScanFilterAndProjectOperator.java","position":19,"original_position":19,"commit_id":"9e8f8c07164308a713c98c2420f7df3a7d2013d0","original_commit_id":"9e8f8c07164308a713c98c2420f7df3a7d2013d0","user":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"body":"I don't think this is the right place to be freeing system memory. `isFinished()` indicates that the operator is done, but this doesn't mean it's actually going to be garbage collected. I would probably put this in `Driver.destroyIfNecessary` where the other memory is released","created_at":"2015-11-09T21:34:42Z","updated_at":"2015-11-09T21:34:42Z","html_url":"https://github.com/facebook/presto/pull/3686#discussion_r44335366","pull_request_url":"https://api.github.com/repos/facebook/presto/pulls/3686","_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments/44335366"},"html":{"href":"https://github.com/facebook/presto/pull/3686#discussion_r44335366"},"pull_request":{"href":"https://api.github.com/repos/facebook/presto/pulls/3686"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/3686","id":46312773,"html_url":"https://github.com/facebook/presto/pull/3686","diff_url":"https://github.com/facebook/presto/pull/3686.diff","patch_url":"https://github.com/facebook/presto/pull/3686.patch","issue_url":"https://api.github.com/repos/facebook/presto/issues/3686","number":3686,"state":"open","locked":false,"title":"Add TableScan, ScanFilterProject memory tracking","user":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"body":"Also added system memory tracking to PageSource. Tracking for RecordCursor has not been added.","created_at":"2015-09-29T18:20:28Z","updated_at":"2015-11-09T21:34:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9232548447aba4985f387bf57add039002f4113","assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/facebook/presto/pulls/3686/commits","review_comments_url":"https://api.github.com/repos/facebook/presto/pulls/3686/comments","review_comment_url":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/presto/issues/3686/comments","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/9e8f8c07164308a713c98c2420f7df3a7d2013d0","head":{"label":"haozhun:tablescan","ref":"tablescan","sha":"9e8f8c07164308a713c98c2420f7df3a7d2013d0","user":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"repo":{"id":31032158,"name":"presto","full_name":"haozhun/presto","owner":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haozhun/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/haozhun/presto","forks_url":"https://api.github.com/repos/haozhun/presto/forks","keys_url":"https://api.github.com/repos/haozhun/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haozhun/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haozhun/presto/teams","hooks_url":"https://api.github.com/repos/haozhun/presto/hooks","issue_events_url":"https://api.github.com/repos/haozhun/presto/issues/events{/number}","events_url":"https://api.github.com/repos/haozhun/presto/events","assignees_url":"https://api.github.com/repos/haozhun/presto/assignees{/user}","branches_url":"https://api.github.com/repos/haozhun/presto/branches{/branch}","tags_url":"https://api.github.com/repos/haozhun/presto/tags","blobs_url":"https://api.github.com/repos/haozhun/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haozhun/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haozhun/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/haozhun/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haozhun/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/haozhun/presto/languages","stargazers_url":"https://api.github.com/repos/haozhun/presto/stargazers","contributors_url":"https://api.github.com/repos/haozhun/presto/contributors","subscribers_url":"https://api.github.com/repos/haozhun/presto/subscribers","subscription_url":"https://api.github.com/repos/haozhun/presto/subscription","commits_url":"https://api.github.com/repos/haozhun/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/haozhun/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/haozhun/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/haozhun/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/haozhun/presto/contents/{+path}","compare_url":"https://api.github.com/repos/haozhun/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haozhun/presto/merges","archive_url":"https://api.github.com/repos/haozhun/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haozhun/presto/downloads","issues_url":"https://api.github.com/repos/haozhun/presto/issues{/number}","pulls_url":"https://api.github.com/repos/haozhun/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/haozhun/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/haozhun/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haozhun/presto/labels{/name}","releases_url":"https://api.github.com/repos/haozhun/presto/releases{/id}","created_at":"2015-02-19T19:19:31Z","updated_at":"2015-04-04T00:15:06Z","pushed_at":"2015-11-09T19:46:07Z","git_url":"git://github.com/haozhun/presto.git","ssh_url":"git@github.com:haozhun/presto.git","clone_url":"https://github.com/haozhun/presto.git","svn_url":"https://github.com/haozhun/presto","homepage":"https://prestodb.io","size":49658,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"1adf1ce7d06d13559a9e8aa0c38e4f946426fcb8","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"facebook/presto","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":false,"url":"https://api.github.com/repos/facebook/presto","forks_url":"https://api.github.com/repos/facebook/presto/forks","keys_url":"https://api.github.com/repos/facebook/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/presto/teams","hooks_url":"https://api.github.com/repos/facebook/presto/hooks","issue_events_url":"https://api.github.com/repos/facebook/presto/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/presto/events","assignees_url":"https://api.github.com/repos/facebook/presto/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/presto/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/presto/tags","blobs_url":"https://api.github.com/repos/facebook/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/presto/languages","stargazers_url":"https://api.github.com/repos/facebook/presto/stargazers","contributors_url":"https://api.github.com/repos/facebook/presto/contributors","subscribers_url":"https://api.github.com/repos/facebook/presto/subscribers","subscription_url":"https://api.github.com/repos/facebook/presto/subscription","commits_url":"https://api.github.com/repos/facebook/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/presto/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/presto/merges","archive_url":"https://api.github.com/repos/facebook/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/presto/downloads","issues_url":"https://api.github.com/repos/facebook/presto/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/presto/labels{/name}","releases_url":"https://api.github.com/repos/facebook/presto/releases{/id}","created_at":"2012-08-09T01:03:37Z","updated_at":"2015-11-09T20:26:09Z","pushed_at":"2015-11-09T21:30:03Z","git_url":"git://github.com/facebook/presto.git","ssh_url":"git@github.com:facebook/presto.git","clone_url":"https://github.com/facebook/presto.git","svn_url":"https://github.com/facebook/presto","homepage":"https://prestodb.io","size":146078,"stargazers_count":4079,"watchers_count":4079,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1068,"mirror_url":null,"open_issues_count":349,"forks":1068,"open_issues":349,"watchers":4079,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/3686"},"html":{"href":"https://github.com/facebook/presto/pull/3686"},"issue":{"href":"https://api.github.com/repos/facebook/presto/issues/3686"},"comments":{"href":"https://api.github.com/repos/facebook/presto/issues/3686/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/presto/pulls/3686/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/presto/pulls/3686/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/presto/statuses/9e8f8c07164308a713c98c2420f7df3a7d2013d0"}}}}