{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/88588204","pull_request_review_id":9158256,"id":88588204,"diff_hunk":"@@ -88,6 +88,7 @@ func (pq *priorityQueue) Pop() interface{} {\n \tn := len(old)\n \titem := old[n-1]\n \titem.index = -1 // for safety\n+\told[n-1] = nil // for gc","path":"pkg/storage/queue.go","position":4,"original_position":4,"commit_id":"105ea5ff7ba405875fcc5c32071054c9aedd66f4","original_commit_id":"105ea5ff7ba405875fcc5c32071054c9aedd66f4","user":{"login":"tamird","id":1535036,"avatar_url":"https://avatars.githubusercontent.com/u/1535036?v=3","gravatar_id":"","url":"https://api.github.com/users/tamird","html_url":"https://github.com/tamird","followers_url":"https://api.github.com/users/tamird/followers","following_url":"https://api.github.com/users/tamird/following{/other_user}","gists_url":"https://api.github.com/users/tamird/gists{/gist_id}","starred_url":"https://api.github.com/users/tamird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamird/subscriptions","organizations_url":"https://api.github.com/users/tamird/orgs","repos_url":"https://api.github.com/users/tamird/repos","events_url":"https://api.github.com/users/tamird/events{/privacy}","received_events_url":"https://api.github.com/users/tamird/received_events","type":"User","site_admin":false},"body":"There should be only one space after `//`","created_at":"2016-11-18T02:07:21Z","updated_at":"2016-11-18T02:07:49Z","html_url":"https://github.com/cockroachdb/cockroach/pull/10777#discussion_r88588204","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/88588204"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/10777#discussion_r88588204"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777","id":94283311,"html_url":"https://github.com/cockroachdb/cockroach/pull/10777","diff_url":"https://github.com/cockroachdb/cockroach/pull/10777.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/10777.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/10777","number":10777,"state":"open","locked":false,"title":"storage: fix potential memory leak in the pq","user":{"login":"dzyp","id":1445580,"avatar_url":"https://avatars.githubusercontent.com/u/1445580?v=3","gravatar_id":"","url":"https://api.github.com/users/dzyp","html_url":"https://github.com/dzyp","followers_url":"https://api.github.com/users/dzyp/followers","following_url":"https://api.github.com/users/dzyp/following{/other_user}","gists_url":"https://api.github.com/users/dzyp/gists{/gist_id}","starred_url":"https://api.github.com/users/dzyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzyp/subscriptions","organizations_url":"https://api.github.com/users/dzyp/orgs","repos_url":"https://api.github.com/users/dzyp/repos","events_url":"https://api.github.com/users/dzyp/events{/privacy}","received_events_url":"https://api.github.com/users/dzyp/received_events","type":"User","site_admin":false},"body":"Simple fix, without setting the last item to nil, you will shrink the slice pointer but the memory location will still exist and reference the no longer needed item.  This nils out the last position before shrinking the slice so the GC will collect orphaned items.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/10777)\n<!-- Reviewable:end -->\n","created_at":"2016-11-18T00:49:30Z","updated_at":"2016-11-18T02:07:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ccf663c92ba7f6f7cb3c95389e63b7caec2d6614","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/10777/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/105ea5ff7ba405875fcc5c32071054c9aedd66f4","head":{"label":"dzyp:fix-memory-leak","ref":"fix-memory-leak","sha":"105ea5ff7ba405875fcc5c32071054c9aedd66f4","user":{"login":"dzyp","id":1445580,"avatar_url":"https://avatars.githubusercontent.com/u/1445580?v=3","gravatar_id":"","url":"https://api.github.com/users/dzyp","html_url":"https://github.com/dzyp","followers_url":"https://api.github.com/users/dzyp/followers","following_url":"https://api.github.com/users/dzyp/following{/other_user}","gists_url":"https://api.github.com/users/dzyp/gists{/gist_id}","starred_url":"https://api.github.com/users/dzyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzyp/subscriptions","organizations_url":"https://api.github.com/users/dzyp/orgs","repos_url":"https://api.github.com/users/dzyp/repos","events_url":"https://api.github.com/users/dzyp/events{/privacy}","received_events_url":"https://api.github.com/users/dzyp/received_events","type":"User","site_admin":false},"repo":{"id":74079772,"name":"cockroach","full_name":"dzyp/cockroach","owner":{"login":"dzyp","id":1445580,"avatar_url":"https://avatars.githubusercontent.com/u/1445580?v=3","gravatar_id":"","url":"https://api.github.com/users/dzyp","html_url":"https://github.com/dzyp","followers_url":"https://api.github.com/users/dzyp/followers","following_url":"https://api.github.com/users/dzyp/following{/other_user}","gists_url":"https://api.github.com/users/dzyp/gists{/gist_id}","starred_url":"https://api.github.com/users/dzyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzyp/subscriptions","organizations_url":"https://api.github.com/users/dzyp/orgs","repos_url":"https://api.github.com/users/dzyp/repos","events_url":"https://api.github.com/users/dzyp/events{/privacy}","received_events_url":"https://api.github.com/users/dzyp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dzyp/cockroach","description":"A Scalable, Survivable, Strongly-Consistent SQL Database","fork":true,"url":"https://api.github.com/repos/dzyp/cockroach","forks_url":"https://api.github.com/repos/dzyp/cockroach/forks","keys_url":"https://api.github.com/repos/dzyp/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dzyp/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dzyp/cockroach/teams","hooks_url":"https://api.github.com/repos/dzyp/cockroach/hooks","issue_events_url":"https://api.github.com/repos/dzyp/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/dzyp/cockroach/events","assignees_url":"https://api.github.com/repos/dzyp/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/dzyp/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/dzyp/cockroach/tags","blobs_url":"https://api.github.com/repos/dzyp/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dzyp/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dzyp/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/dzyp/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dzyp/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/dzyp/cockroach/languages","stargazers_url":"https://api.github.com/repos/dzyp/cockroach/stargazers","contributors_url":"https://api.github.com/repos/dzyp/cockroach/contributors","subscribers_url":"https://api.github.com/repos/dzyp/cockroach/subscribers","subscription_url":"https://api.github.com/repos/dzyp/cockroach/subscription","commits_url":"https://api.github.com/repos/dzyp/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/dzyp/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/dzyp/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/dzyp/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/dzyp/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/dzyp/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dzyp/cockroach/merges","archive_url":"https://api.github.com/repos/dzyp/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dzyp/cockroach/downloads","issues_url":"https://api.github.com/repos/dzyp/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/dzyp/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/dzyp/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/dzyp/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dzyp/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/dzyp/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/dzyp/cockroach/deployments","created_at":"2016-11-18T00:31:32Z","updated_at":"2016-11-18T00:31:39Z","pushed_at":"2016-11-18T00:32:13Z","git_url":"git://github.com/dzyp/cockroach.git","ssh_url":"git@github.com:dzyp/cockroach.git","clone_url":"https://github.com/dzyp/cockroach.git","svn_url":"https://github.com/dzyp/cockroach","homepage":"https://www.cockroachlabs.com","size":222077,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"cockroachdb:master","ref":"master","sha":"fc005bea58c1483f4b54d06550cce0898862fe78","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Survivable, Strongly-Consistent SQL Database","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/cockroachdb/cockroach/deployments","created_at":"2014-02-06T00:18:47Z","updated_at":"2016-11-17T12:32:02Z","pushed_at":"2016-11-18T01:14:14Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":"https://www.cockroachlabs.com","size":406760,"stargazers_count":7906,"watchers_count":7906,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":801,"mirror_url":null,"open_issues_count":822,"forks":801,"open_issues":822,"watchers":7906,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/10777"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/10777"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/10777/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/10777/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/105ea5ff7ba405875fcc5c32071054c9aedd66f4"}}}}
{"actor":{"display_login":"tamird"}}