{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/presto/issues/3414","labels_url":"https://api.github.com/repos/facebook/presto/issues/3414/labels{/name}","comments_url":"https://api.github.com/repos/facebook/presto/issues/3414/comments","events_url":"https://api.github.com/repos/facebook/presto/issues/3414/events","html_url":"https://github.com/facebook/presto/pull/3414","id":99401645,"number":3414,"title":"Fix missed memory tracking at HashBuilderOperator","user":{"login":"miniway","id":725129,"avatar_url":"https://avatars.githubusercontent.com/u/725129?v=3","gravatar_id":"","url":"https://api.github.com/users/miniway","html_url":"https://github.com/miniway","followers_url":"https://api.github.com/users/miniway/followers","following_url":"https://api.github.com/users/miniway/following{/other_user}","gists_url":"https://api.github.com/users/miniway/gists{/gist_id}","starred_url":"https://api.github.com/users/miniway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miniway/subscriptions","organizations_url":"https://api.github.com/users/miniway/orgs","repos_url":"https://api.github.com/users/miniway/repos","events_url":"https://api.github.com/users/miniway/events{/privacy}","received_events_url":"https://api.github.com/users/miniway/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/presto/labels/CLA%20Signed","name":"CLA Signed","color":"ededed"}],"state":"open","locked":false,"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,"comments":1,"created_at":"2015-08-06T10:04:08Z","updated_at":"2015-08-21T23:41:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/3414","html_url":"https://github.com/facebook/presto/pull/3414","diff_url":"https://github.com/facebook/presto/pull/3414.diff","patch_url":"https://github.com/facebook/presto/pull/3414.patch"},"body":"I found that some memory usages are not collected correctly. \r\n* `PageBuilder.getSizeInBytres` returns  used bytes not allocated bytes. '\r\n* `InMemoryJoinHash` which is created from `PagesIndex.createLookupSource` only returns its own data structures size at `getInMemorySizeInBytes`.\r\n\r\nI tried making  `InMemoryJoinHash.getInMemorySizeInBytes ` return total memory usage including `PagesIndex` had used, But it required several interface changes at `JoinCompiler`"},"comment":{"url":"https://api.github.com/repos/facebook/presto/issues/comments/133591226","html_url":"https://github.com/facebook/presto/pull/3414#issuecomment-133591226","issue_url":"https://api.github.com/repos/facebook/presto/issues/3414","id":133591226,"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},"created_at":"2015-08-21T23:41:31Z","updated_at":"2015-08-21T23:41:31Z","body":"I think it would be better to change `PagesHashStrategy` to have a `getSizeInBytes()` method and then implement that in the compiler and add it to the size of the `InMemoryJoinHash`. It'll be a bit more work, but I think it will be a cleaner interface than having the `SharedLookupSource` track that memory separately"}}