{"action":"closed","number":829,"pull_request":{"url":"https://api.github.com/repos/Commonjava/indy/pulls/829","id":151852791,"html_url":"https://github.com/Commonjava/indy/pull/829","diff_url":"https://github.com/Commonjava/indy/pull/829.diff","patch_url":"https://github.com/Commonjava/indy/pull/829.patch","issue_url":"https://api.github.com/repos/Commonjava/indy/issues/829","number":829,"state":"closed","locked":false,"title":"Use softreference as key for ExpiringMemoryNotFoundCache to avoid OOM","user":{"login":"ruhan1","id":6487802,"avatar_url":"https://avatars0.githubusercontent.com/u/6487802?v=4","gravatar_id":"","url":"https://api.github.com/users/ruhan1","html_url":"https://github.com/ruhan1","followers_url":"https://api.github.com/users/ruhan1/followers","following_url":"https://api.github.com/users/ruhan1/following{/other_user}","gists_url":"https://api.github.com/users/ruhan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ruhan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruhan1/subscriptions","organizations_url":"https://api.github.com/users/ruhan1/orgs","repos_url":"https://api.github.com/users/ruhan1/repos","events_url":"https://api.github.com/users/ruhan1/events{/privacy}","received_events_url":"https://api.github.com/users/ruhan1/received_events","type":"User","site_admin":false},"body":"According to my debug, the NFC is a big memory eater. I rewrite the ExpiringMemoryNotFoundCache with a soft reference as the key. This can not 100% avoid the OOM since the entries in the Map may not get cleared if the user doesn't call the NfcResource clearing REST APIs. However, this makes sure the heavy ConcreteResources are GC-ed before an OOM occurs. With this fix, I believe Indy can survive much longer and the user should have more chance to call the clear API, in a cheap way. We can 100% avoid the bloating of the Map by running clearAllExpiredMissing more aggressively in the addMissing(). But that will harm the performance so I did not do it. Maybe we can use something like a scheduled job to do the periodical clearing. I will leave further work to master branch. BTW, I added some synchronized blocks to protect the Map from being corrupted. I did not use ConcurrentHashMap because we may iterate over and add/remove concurrently, and a simple ConcurrentHashMap won't suffice. ","created_at":"2017-11-10T08:40:43Z","updated_at":"2017-11-20T03:55:10Z","closed_at":"2017-11-20T03:55:10Z","merged_at":null,"merge_commit_sha":"76b147ac4a148b68fe58afdeef76b4cd6aeb69ac","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Commonjava/indy/pulls/829/commits","review_comments_url":"https://api.github.com/repos/Commonjava/indy/pulls/829/comments","review_comment_url":"https://api.github.com/repos/Commonjava/indy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Commonjava/indy/issues/829/comments","statuses_url":"https://api.github.com/repos/Commonjava/indy/statuses/2af962cfb693408e64b96b48cb8fe27cb98f837a","head":{"label":"ruhan1:indy-1.1.x-oom","ref":"indy-1.1.x-oom","sha":"2af962cfb693408e64b96b48cb8fe27cb98f837a","user":{"login":"ruhan1","id":6487802,"avatar_url":"https://avatars0.githubusercontent.com/u/6487802?v=4","gravatar_id":"","url":"https://api.github.com/users/ruhan1","html_url":"https://github.com/ruhan1","followers_url":"https://api.github.com/users/ruhan1/followers","following_url":"https://api.github.com/users/ruhan1/following{/other_user}","gists_url":"https://api.github.com/users/ruhan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ruhan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruhan1/subscriptions","organizations_url":"https://api.github.com/users/ruhan1/orgs","repos_url":"https://api.github.com/users/ruhan1/repos","events_url":"https://api.github.com/users/ruhan1/events{/privacy}","received_events_url":"https://api.github.com/users/ruhan1/received_events","type":"User","site_admin":false},"repo":{"id":67480191,"name":"indy","full_name":"ruhan1/indy","owner":{"login":"ruhan1","id":6487802,"avatar_url":"https://avatars0.githubusercontent.com/u/6487802?v=4","gravatar_id":"","url":"https://api.github.com/users/ruhan1","html_url":"https://github.com/ruhan1","followers_url":"https://api.github.com/users/ruhan1/followers","following_url":"https://api.github.com/users/ruhan1/following{/other_user}","gists_url":"https://api.github.com/users/ruhan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ruhan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruhan1/subscriptions","organizations_url":"https://api.github.com/users/ruhan1/orgs","repos_url":"https://api.github.com/users/ruhan1/repos","events_url":"https://api.github.com/users/ruhan1/events{/privacy}","received_events_url":"https://api.github.com/users/ruhan1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ruhan1/indy","description":"Simple artifact proxy for maven and similar build tools","fork":true,"url":"https://api.github.com/repos/ruhan1/indy","forks_url":"https://api.github.com/repos/ruhan1/indy/forks","keys_url":"https://api.github.com/repos/ruhan1/indy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruhan1/indy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruhan1/indy/teams","hooks_url":"https://api.github.com/repos/ruhan1/indy/hooks","issue_events_url":"https://api.github.com/repos/ruhan1/indy/issues/events{/number}","events_url":"https://api.github.com/repos/ruhan1/indy/events","assignees_url":"https://api.github.com/repos/ruhan1/indy/assignees{/user}","branches_url":"https://api.github.com/repos/ruhan1/indy/branches{/branch}","tags_url":"https://api.github.com/repos/ruhan1/indy/tags","blobs_url":"https://api.github.com/repos/ruhan1/indy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruhan1/indy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruhan1/indy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruhan1/indy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruhan1/indy/statuses/{sha}","languages_url":"https://api.github.com/repos/ruhan1/indy/languages","stargazers_url":"https://api.github.com/repos/ruhan1/indy/stargazers","contributors_url":"https://api.github.com/repos/ruhan1/indy/contributors","subscribers_url":"https://api.github.com/repos/ruhan1/indy/subscribers","subscription_url":"https://api.github.com/repos/ruhan1/indy/subscription","commits_url":"https://api.github.com/repos/ruhan1/indy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruhan1/indy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruhan1/indy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruhan1/indy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruhan1/indy/contents/{+path}","compare_url":"https://api.github.com/repos/ruhan1/indy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruhan1/indy/merges","archive_url":"https://api.github.com/repos/ruhan1/indy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruhan1/indy/downloads","issues_url":"https://api.github.com/repos/ruhan1/indy/issues{/number}","pulls_url":"https://api.github.com/repos/ruhan1/indy/pulls{/number}","milestones_url":"https://api.github.com/repos/ruhan1/indy/milestones{/number}","notifications_url":"https://api.github.com/repos/ruhan1/indy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruhan1/indy/labels{/name}","releases_url":"https://api.github.com/repos/ruhan1/indy/releases{/id}","deployments_url":"https://api.github.com/repos/ruhan1/indy/deployments","created_at":"2016-09-06T06:32:37Z","updated_at":"2016-09-06T06:32:41Z","pushed_at":"2017-11-16T09:14:55Z","git_url":"git://github.com/ruhan1/indy.git","ssh_url":"git@github.com:ruhan1/indy.git","clone_url":"https://github.com/ruhan1/indy.git","svn_url":"https://github.com/ruhan1/indy","homepage":"","size":21535,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Commonjava:indy-1.1.x","ref":"indy-1.1.x","sha":"9c12d5ce708cde3b241a4bf69598286dacdea25b","user":{"login":"Commonjava","id":12036517,"avatar_url":"https://avatars2.githubusercontent.com/u/12036517?v=4","gravatar_id":"","url":"https://api.github.com/users/Commonjava","html_url":"https://github.com/Commonjava","followers_url":"https://api.github.com/users/Commonjava/followers","following_url":"https://api.github.com/users/Commonjava/following{/other_user}","gists_url":"https://api.github.com/users/Commonjava/gists{/gist_id}","starred_url":"https://api.github.com/users/Commonjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Commonjava/subscriptions","organizations_url":"https://api.github.com/users/Commonjava/orgs","repos_url":"https://api.github.com/users/Commonjava/repos","events_url":"https://api.github.com/users/Commonjava/events{/privacy}","received_events_url":"https://api.github.com/users/Commonjava/received_events","type":"Organization","site_admin":false},"repo":{"id":2431562,"name":"indy","full_name":"Commonjava/indy","owner":{"login":"Commonjava","id":12036517,"avatar_url":"https://avatars2.githubusercontent.com/u/12036517?v=4","gravatar_id":"","url":"https://api.github.com/users/Commonjava","html_url":"https://github.com/Commonjava","followers_url":"https://api.github.com/users/Commonjava/followers","following_url":"https://api.github.com/users/Commonjava/following{/other_user}","gists_url":"https://api.github.com/users/Commonjava/gists{/gist_id}","starred_url":"https://api.github.com/users/Commonjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Commonjava/subscriptions","organizations_url":"https://api.github.com/users/Commonjava/orgs","repos_url":"https://api.github.com/users/Commonjava/repos","events_url":"https://api.github.com/users/Commonjava/events{/privacy}","received_events_url":"https://api.github.com/users/Commonjava/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Commonjava/indy","description":"Simple artifact proxy for maven and similar build tools","fork":false,"url":"https://api.github.com/repos/Commonjava/indy","forks_url":"https://api.github.com/repos/Commonjava/indy/forks","keys_url":"https://api.github.com/repos/Commonjava/indy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Commonjava/indy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Commonjava/indy/teams","hooks_url":"https://api.github.com/repos/Commonjava/indy/hooks","issue_events_url":"https://api.github.com/repos/Commonjava/indy/issues/events{/number}","events_url":"https://api.github.com/repos/Commonjava/indy/events","assignees_url":"https://api.github.com/repos/Commonjava/indy/assignees{/user}","branches_url":"https://api.github.com/repos/Commonjava/indy/branches{/branch}","tags_url":"https://api.github.com/repos/Commonjava/indy/tags","blobs_url":"https://api.github.com/repos/Commonjava/indy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Commonjava/indy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Commonjava/indy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Commonjava/indy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Commonjava/indy/statuses/{sha}","languages_url":"https://api.github.com/repos/Commonjava/indy/languages","stargazers_url":"https://api.github.com/repos/Commonjava/indy/stargazers","contributors_url":"https://api.github.com/repos/Commonjava/indy/contributors","subscribers_url":"https://api.github.com/repos/Commonjava/indy/subscribers","subscription_url":"https://api.github.com/repos/Commonjava/indy/subscription","commits_url":"https://api.github.com/repos/Commonjava/indy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Commonjava/indy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Commonjava/indy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Commonjava/indy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Commonjava/indy/contents/{+path}","compare_url":"https://api.github.com/repos/Commonjava/indy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Commonjava/indy/merges","archive_url":"https://api.github.com/repos/Commonjava/indy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Commonjava/indy/downloads","issues_url":"https://api.github.com/repos/Commonjava/indy/issues{/number}","pulls_url":"https://api.github.com/repos/Commonjava/indy/pulls{/number}","milestones_url":"https://api.github.com/repos/Commonjava/indy/milestones{/number}","notifications_url":"https://api.github.com/repos/Commonjava/indy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Commonjava/indy/labels{/name}","releases_url":"https://api.github.com/repos/Commonjava/indy/releases{/id}","deployments_url":"https://api.github.com/repos/Commonjava/indy/deployments","created_at":"2011-09-21T17:55:24Z","updated_at":"2017-08-31T21:01:45Z","pushed_at":"2017-11-16T23:59:53Z","git_url":"git://github.com/Commonjava/indy.git","ssh_url":"git@github.com:Commonjava/indy.git","clone_url":"https://github.com/Commonjava/indy.git","svn_url":"https://github.com/Commonjava/indy","homepage":"","size":22095,"stargazers_count":11,"watchers_count":11,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":16,"forks":17,"open_issues":16,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Commonjava/indy/pulls/829"},"html":{"href":"https://github.com/Commonjava/indy/pull/829"},"issue":{"href":"https://api.github.com/repos/Commonjava/indy/issues/829"},"comments":{"href":"https://api.github.com/repos/Commonjava/indy/issues/829/comments"},"review_comments":{"href":"https://api.github.com/repos/Commonjava/indy/pulls/829/comments"},"review_comment":{"href":"https://api.github.com/repos/Commonjava/indy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Commonjava/indy/pulls/829/commits"},"statuses":{"href":"https://api.github.com/repos/Commonjava/indy/statuses/2af962cfb693408e64b96b48cb8fe27cb98f837a"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":3,"review_comments":3,"maintainer_can_modify":false,"commits":1,"additions":133,"deletions":24,"changed_files":1}}
{"actor":{"display_login":"ruhan1"}}