{"action":"created","comment":{"url":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments/50830470","id":50830470,"diff_hunk":"@@ -1283,14 +1413,70 @@ private static long safeExpireTime(long now, Duration duration) {\n     return result;\n   }\n   \n-  private void enforceCapacity(int delta) {\n-    for (int attempts = 0, evicted = 0; attempts < ATTEMPT_RATIO * delta && evicted < EVICTION_RATIO * delta\n-            && capacity < map.size(); attempts++) {\n+  private void enforceByteCapacity() {\n+    while (capacity < currentUsageinBytes.get()) {\n+      evict();\n+    }\n+  }\n+ \n+  private void incrementCurrentUsageInBytesIfRequired(long delta) {\n+    if(byteSized) {\n+      while(true) {\n+        long expect =  currentUsageinBytes.get();\n+        long update = expect + delta;\n+        if(currentUsageinBytes.compareAndSet(expect, update)) {\n+          break;\n+        }\n+      }\n+    }\n+  }\n+  \n+  private void decrementCurrentUsageInBytesIfRequired(long delta) {\n+    if(byteSized) {\n+      while(true) {\n+        long expect =  currentUsageinBytes.get();\n+        long update = expect - delta;\n+        if(update < 0l) {\n+          //Either this happened due to race \n+          //or the size estimation screwed up somewhere\n+          //come out silently or throw ?\n+          throw new AssertionError(\"It's screwed\");","path":"impl/src/main/java/org/ehcache/internal/store/heap/OnHeapStore.java","position":558,"original_position":558,"commit_id":"758c5b80a1bda2266228e5b07e14bd2bac2ba336","original_commit_id":"758c5b80a1bda2266228e5b07e14bd2bac2ba336","user":{"login":"lorban","id":622925,"avatar_url":"https://avatars.githubusercontent.com/u/622925?v=3","gravatar_id":"","url":"https://api.github.com/users/lorban","html_url":"https://github.com/lorban","followers_url":"https://api.github.com/users/lorban/followers","following_url":"https://api.github.com/users/lorban/following{/other_user}","gists_url":"https://api.github.com/users/lorban/gists{/gist_id}","starred_url":"https://api.github.com/users/lorban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorban/subscriptions","organizations_url":"https://api.github.com/users/lorban/orgs","repos_url":"https://api.github.com/users/lorban/repos","events_url":"https://api.github.com/users/lorban/events{/privacy}","received_events_url":"https://api.github.com/users/lorban/received_events","type":"User","site_admin":false},"body":"I don't think we'll want to keep this assertion.","created_at":"2016-01-26T12:51:42Z","updated_at":"2016-01-26T12:51:42Z","html_url":"https://github.com/ehcache/ehcache3/pull/731#discussion_r50830470","pull_request_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/731","_links":{"self":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments/50830470"},"html":{"href":"https://github.com/ehcache/ehcache3/pull/731#discussion_r50830470"},"pull_request":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/731"}}},"pull_request":{"url":"https://api.github.com/repos/ehcache/ehcache3/pulls/731","id":56429576,"html_url":"https://github.com/ehcache/ehcache3/pull/731","diff_url":"https://github.com/ehcache/ehcache3/pull/731.diff","patch_url":"https://github.com/ehcache/ehcache3/pull/731.patch","issue_url":"https://api.github.com/repos/ehcache/ehcache3/issues/731","number":731,"state":"open","locked":false,"title":"Issue 616","user":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"body":"OSGI tests failing","created_at":"2016-01-19T07:13:45Z","updated_at":"2016-01-26T12:51:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d330e54940a6a417c6bf71b8897bf078fd25627","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/731/commits","review_comments_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/731/comments","review_comment_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/issues/731/comments","statuses_url":"https://api.github.com/repos/ehcache/ehcache3/statuses/758c5b80a1bda2266228e5b07e14bd2bac2ba336","head":{"label":"AbfrmBlr:issue-616","ref":"issue-616","sha":"758c5b80a1bda2266228e5b07e14bd2bac2ba336","user":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"repo":{"id":28589092,"name":"ehcache3","full_name":"AbfrmBlr/ehcache3","owner":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AbfrmBlr/ehcache3","description":"Ehcache 3.x line ","fork":true,"url":"https://api.github.com/repos/AbfrmBlr/ehcache3","forks_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/forks","keys_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/teams","hooks_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/hooks","issue_events_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/issues/events{/number}","events_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/events","assignees_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/assignees{/user}","branches_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/branches{/branch}","tags_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/tags","blobs_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/refs{/sha}","trees_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/statuses/{sha}","languages_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/languages","stargazers_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/stargazers","contributors_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/contributors","subscribers_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/subscribers","subscription_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/subscription","commits_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/commits{/sha}","git_commits_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/commits{/sha}","comments_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/comments{/number}","issue_comment_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/issues/comments{/number}","contents_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/contents/{+path}","compare_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/merges","archive_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/downloads","issues_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/issues{/number}","pulls_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/pulls{/number}","milestones_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/milestones{/number}","notifications_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/labels{/name}","releases_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/releases{/id}","deployments_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/deployments","created_at":"2014-12-29T10:47:44Z","updated_at":"2016-01-19T07:22:30Z","pushed_at":"2016-01-22T16:42:14Z","git_url":"git://github.com/AbfrmBlr/ehcache3.git","ssh_url":"git@github.com:AbfrmBlr/ehcache3.git","clone_url":"https://github.com/AbfrmBlr/ehcache3.git","svn_url":"https://github.com/AbfrmBlr/ehcache3","homepage":"ehcache.org","size":5541,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"ehcache:master","ref":"master","sha":"1300953bccf0bf9ac225833530041664a8999003","user":{"login":"ehcache","id":5504982,"avatar_url":"https://avatars.githubusercontent.com/u/5504982?v=3","gravatar_id":"","url":"https://api.github.com/users/ehcache","html_url":"https://github.com/ehcache","followers_url":"https://api.github.com/users/ehcache/followers","following_url":"https://api.github.com/users/ehcache/following{/other_user}","gists_url":"https://api.github.com/users/ehcache/gists{/gist_id}","starred_url":"https://api.github.com/users/ehcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehcache/subscriptions","organizations_url":"https://api.github.com/users/ehcache/orgs","repos_url":"https://api.github.com/users/ehcache/repos","events_url":"https://api.github.com/users/ehcache/events{/privacy}","received_events_url":"https://api.github.com/users/ehcache/received_events","type":"Organization","site_admin":false},"repo":{"id":17224514,"name":"ehcache3","full_name":"ehcache/ehcache3","owner":{"login":"ehcache","id":5504982,"avatar_url":"https://avatars.githubusercontent.com/u/5504982?v=3","gravatar_id":"","url":"https://api.github.com/users/ehcache","html_url":"https://github.com/ehcache","followers_url":"https://api.github.com/users/ehcache/followers","following_url":"https://api.github.com/users/ehcache/following{/other_user}","gists_url":"https://api.github.com/users/ehcache/gists{/gist_id}","starred_url":"https://api.github.com/users/ehcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehcache/subscriptions","organizations_url":"https://api.github.com/users/ehcache/orgs","repos_url":"https://api.github.com/users/ehcache/repos","events_url":"https://api.github.com/users/ehcache/events{/privacy}","received_events_url":"https://api.github.com/users/ehcache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ehcache/ehcache3","description":"Ehcache 3.x line ","fork":false,"url":"https://api.github.com/repos/ehcache/ehcache3","forks_url":"https://api.github.com/repos/ehcache/ehcache3/forks","keys_url":"https://api.github.com/repos/ehcache/ehcache3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehcache/ehcache3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehcache/ehcache3/teams","hooks_url":"https://api.github.com/repos/ehcache/ehcache3/hooks","issue_events_url":"https://api.github.com/repos/ehcache/ehcache3/issues/events{/number}","events_url":"https://api.github.com/repos/ehcache/ehcache3/events","assignees_url":"https://api.github.com/repos/ehcache/ehcache3/assignees{/user}","branches_url":"https://api.github.com/repos/ehcache/ehcache3/branches{/branch}","tags_url":"https://api.github.com/repos/ehcache/ehcache3/tags","blobs_url":"https://api.github.com/repos/ehcache/ehcache3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehcache/ehcache3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehcache/ehcache3/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehcache/ehcache3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehcache/ehcache3/statuses/{sha}","languages_url":"https://api.github.com/repos/ehcache/ehcache3/languages","stargazers_url":"https://api.github.com/repos/ehcache/ehcache3/stargazers","contributors_url":"https://api.github.com/repos/ehcache/ehcache3/contributors","subscribers_url":"https://api.github.com/repos/ehcache/ehcache3/subscribers","subscription_url":"https://api.github.com/repos/ehcache/ehcache3/subscription","commits_url":"https://api.github.com/repos/ehcache/ehcache3/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehcache/ehcache3/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehcache/ehcache3/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehcache/ehcache3/contents/{+path}","compare_url":"https://api.github.com/repos/ehcache/ehcache3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehcache/ehcache3/merges","archive_url":"https://api.github.com/repos/ehcache/ehcache3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehcache/ehcache3/downloads","issues_url":"https://api.github.com/repos/ehcache/ehcache3/issues{/number}","pulls_url":"https://api.github.com/repos/ehcache/ehcache3/pulls{/number}","milestones_url":"https://api.github.com/repos/ehcache/ehcache3/milestones{/number}","notifications_url":"https://api.github.com/repos/ehcache/ehcache3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehcache/ehcache3/labels{/name}","releases_url":"https://api.github.com/repos/ehcache/ehcache3/releases{/id}","deployments_url":"https://api.github.com/repos/ehcache/ehcache3/deployments","created_at":"2014-02-26T20:39:16Z","updated_at":"2016-01-26T01:44:07Z","pushed_at":"2016-01-25T11:10:41Z","git_url":"git://github.com/ehcache/ehcache3.git","ssh_url":"git@github.com:ehcache/ehcache3.git","clone_url":"https://github.com/ehcache/ehcache3.git","svn_url":"https://github.com/ehcache/ehcache3","homepage":"http://www.ehcache.org","size":7063,"stargazers_count":261,"watchers_count":261,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":43,"forks":157,"open_issues":43,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/731"},"html":{"href":"https://github.com/ehcache/ehcache3/pull/731"},"issue":{"href":"https://api.github.com/repos/ehcache/ehcache3/issues/731"},"comments":{"href":"https://api.github.com/repos/ehcache/ehcache3/issues/731/comments"},"review_comments":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/731/comments"},"review_comment":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/731/commits"},"statuses":{"href":"https://api.github.com/repos/ehcache/ehcache3/statuses/758c5b80a1bda2266228e5b07e14bd2bac2ba336"}}}}