{"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/46563554","id":46563554,"diff_hunk":"@@ -29,6 +34,25 @@\n public class LocalMapStatsTest extends HazelcastTestSupport {\n \n     @Test\n+    public void testMapStatsAreNotLeaking() throws Exception {","path":"hazelcast/src/test/java/com/hazelcast/map/LocalMapStatsTest.java","position":31,"original_position":31,"commit_id":"785f1283d27034e3829cc0832bbd9fcc45caed91","original_commit_id":"785f1283d27034e3829cc0832bbd9fcc45caed91","user":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"body":"it's something like this sufficient? it makes less assumption about internals. \r\n```java\r\n    @Test\r\n    public void givenMapContainsStatistics_whenDestroyedAndCreatedAgain_thenStatisticsAreReset()  {\r\n        String mapName = randomMapName();\r\n        HazelcastInstance instance = createHazelcastInstance();\r\n        IMap<Integer, Integer> map = instance.getMap(mapName);\r\n        map.put(1, 1);\r\n\r\n        map.destroy();\r\n        map = instance.getMap(mapName);\r\n\r\n        long putOperationCount = map.getLocalMapStats().getPutOperationCount();\r\n        assertEquals(0, putOperationCount);\r\n    }\r\n```","created_at":"2015-12-03T15:17:20Z","updated_at":"2015-12-03T15:17:20Z","html_url":"https://github.com/hazelcast/hazelcast/pull/6971#discussion_r46563554","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/46563554"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6971#discussion_r46563554"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971","id":52505250,"html_url":"https://github.com/hazelcast/hazelcast/pull/6971","diff_url":"https://github.com/hazelcast/hazelcast/pull/6971.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/6971.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6971","number":6971,"state":"open","locked":false,"title":"Fix leaking local map stats","user":{"login":"eminn","id":378108,"avatar_url":"https://avatars.githubusercontent.com/u/378108?v=3","gravatar_id":"","url":"https://api.github.com/users/eminn","html_url":"https://github.com/eminn","followers_url":"https://api.github.com/users/eminn/followers","following_url":"https://api.github.com/users/eminn/following{/other_user}","gists_url":"https://api.github.com/users/eminn/gists{/gist_id}","starred_url":"https://api.github.com/users/eminn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminn/subscriptions","organizations_url":"https://api.github.com/users/eminn/orgs","repos_url":"https://api.github.com/users/eminn/repos","events_url":"https://api.github.com/users/eminn/events{/privacy}","received_events_url":"https://api.github.com/users/eminn/received_events","type":"User","site_admin":false},"body":"Below the results from MapMemoryUsageStressTest\r\n\r\nFixes #6972\r\n\r\nHeap usage on upstream\r\n<img width=\"570\" alt=\"screen shot 2015-12-03 at 10 38 48 am\" src=\"https://cloud.githubusercontent.com/assets/378108/11555588/14027206-99aa-11e5-8da2-006daab88aeb.png\">\r\n\r\nHeap usage with the fixes in this PR\r\n<img width=\"560\" alt=\"screen shot 2015-12-03 at 10 38 39 am\" src=\"https://cloud.githubusercontent.com/assets/378108/11555586/12357ad6-99aa-11e5-9fc1-3c8387b8843f.png\">\r\n","created_at":"2015-12-03T08:39:54Z","updated_at":"2015-12-03T15:17:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53c07fe26eed602e8a18b08febbc20455e70f0d5","assignee":null,"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/71","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.5.5","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/71/labels","id":1421744,"number":71,"title":"3.5.5","description":"","creator":{"login":"gurbuzali","id":1741680,"avatar_url":"https://avatars.githubusercontent.com/u/1741680?v=3","gravatar_id":"","url":"https://api.github.com/users/gurbuzali","html_url":"https://github.com/gurbuzali","followers_url":"https://api.github.com/users/gurbuzali/followers","following_url":"https://api.github.com/users/gurbuzali/following{/other_user}","gists_url":"https://api.github.com/users/gurbuzali/gists{/gist_id}","starred_url":"https://api.github.com/users/gurbuzali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurbuzali/subscriptions","organizations_url":"https://api.github.com/users/gurbuzali/orgs","repos_url":"https://api.github.com/users/gurbuzali/repos","events_url":"https://api.github.com/users/gurbuzali/events{/privacy}","received_events_url":"https://api.github.com/users/gurbuzali/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":30,"state":"open","created_at":"2015-11-20T13:54:07Z","updated_at":"2015-12-03T12:19:51Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6971/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/785f1283d27034e3829cc0832bbd9fcc45caed91","head":{"label":"eminn:fix/leaking-map-stats","ref":"fix/leaking-map-stats","sha":"785f1283d27034e3829cc0832bbd9fcc45caed91","user":{"login":"eminn","id":378108,"avatar_url":"https://avatars.githubusercontent.com/u/378108?v=3","gravatar_id":"","url":"https://api.github.com/users/eminn","html_url":"https://github.com/eminn","followers_url":"https://api.github.com/users/eminn/followers","following_url":"https://api.github.com/users/eminn/following{/other_user}","gists_url":"https://api.github.com/users/eminn/gists{/gist_id}","starred_url":"https://api.github.com/users/eminn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminn/subscriptions","organizations_url":"https://api.github.com/users/eminn/orgs","repos_url":"https://api.github.com/users/eminn/repos","events_url":"https://api.github.com/users/eminn/events{/privacy}","received_events_url":"https://api.github.com/users/eminn/received_events","type":"User","site_admin":false},"repo":{"id":6697413,"name":"hazelcast","full_name":"eminn/hazelcast","owner":{"login":"eminn","id":378108,"avatar_url":"https://avatars.githubusercontent.com/u/378108?v=3","gravatar_id":"","url":"https://api.github.com/users/eminn","html_url":"https://github.com/eminn","followers_url":"https://api.github.com/users/eminn/followers","following_url":"https://api.github.com/users/eminn/following{/other_user}","gists_url":"https://api.github.com/users/eminn/gists{/gist_id}","starred_url":"https://api.github.com/users/eminn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminn/subscriptions","organizations_url":"https://api.github.com/users/eminn/orgs","repos_url":"https://api.github.com/users/eminn/repos","events_url":"https://api.github.com/users/eminn/events{/privacy}","received_events_url":"https://api.github.com/users/eminn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eminn/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/eminn/hazelcast","forks_url":"https://api.github.com/repos/eminn/hazelcast/forks","keys_url":"https://api.github.com/repos/eminn/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eminn/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eminn/hazelcast/teams","hooks_url":"https://api.github.com/repos/eminn/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/eminn/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/eminn/hazelcast/events","assignees_url":"https://api.github.com/repos/eminn/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/eminn/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/eminn/hazelcast/tags","blobs_url":"https://api.github.com/repos/eminn/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eminn/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eminn/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/eminn/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eminn/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/eminn/hazelcast/languages","stargazers_url":"https://api.github.com/repos/eminn/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/eminn/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/eminn/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/eminn/hazelcast/subscription","commits_url":"https://api.github.com/repos/eminn/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/eminn/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/eminn/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/eminn/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/eminn/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/eminn/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eminn/hazelcast/merges","archive_url":"https://api.github.com/repos/eminn/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eminn/hazelcast/downloads","issues_url":"https://api.github.com/repos/eminn/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/eminn/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/eminn/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/eminn/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eminn/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/eminn/hazelcast/releases{/id}","created_at":"2012-11-15T00:39:03Z","updated_at":"2015-11-19T21:10:34Z","pushed_at":"2015-12-03T14:47:16Z","git_url":"git://github.com/eminn/hazelcast.git","ssh_url":"git@github.com:eminn/hazelcast.git","clone_url":"https://github.com/eminn/hazelcast.git","svn_url":"https://github.com/eminn/hazelcast","homepage":"www.hazelcast.com","size":81054,"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":"hazelcast:maintenance-3.x","ref":"maintenance-3.x","sha":"00cc50ec0d92d2bc1f7dfb8c1cfd4f569ad84cdc","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"repo":{"id":3786237,"name":"hazelcast","full_name":"hazelcast/hazelcast","owner":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hazelcast/hazelcast","description":"Open Source In-Memory Data Grid","fork":false,"url":"https://api.github.com/repos/hazelcast/hazelcast","forks_url":"https://api.github.com/repos/hazelcast/hazelcast/forks","keys_url":"https://api.github.com/repos/hazelcast/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hazelcast/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hazelcast/hazelcast/teams","hooks_url":"https://api.github.com/repos/hazelcast/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hazelcast/hazelcast/events","assignees_url":"https://api.github.com/repos/hazelcast/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hazelcast/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hazelcast/hazelcast/tags","blobs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hazelcast/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hazelcast/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hazelcast/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hazelcast/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hazelcast/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hazelcast/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hazelcast/hazelcast/subscription","commits_url":"https://api.github.com/repos/hazelcast/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hazelcast/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/hazelcast/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hazelcast/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hazelcast/hazelcast/merges","archive_url":"https://api.github.com/repos/hazelcast/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hazelcast/hazelcast/downloads","issues_url":"https://api.github.com/repos/hazelcast/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hazelcast/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hazelcast/hazelcast/releases{/id}","created_at":"2012-03-21T12:25:18Z","updated_at":"2015-12-03T14:43:00Z","pushed_at":"2015-12-03T14:47:17Z","git_url":"git://github.com/hazelcast/hazelcast.git","ssh_url":"git@github.com:hazelcast/hazelcast.git","clone_url":"https://github.com/hazelcast/hazelcast.git","svn_url":"https://github.com/hazelcast/hazelcast","homepage":"www.hazelcast.com","size":93188,"stargazers_count":1331,"watchers_count":1331,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":646,"mirror_url":null,"open_issues_count":492,"forks":646,"open_issues":492,"watchers":1331,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6971"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6971"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6971/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6971/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/785f1283d27034e3829cc0832bbd9fcc45caed91"}}}}