{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments/93189803","pull_request_review_id":13710462,"id":93189803,"diff_hunk":"@@ -61,3 +70,59 @@ Plugin Interoperability\n =======================\n \n An explanation of how to communicate with other plugins, *TBA*.\n+\n+\n+Bad Practices\n+=============\n+\n+These should practices should be avoided. As they lead to memory leaks (``OutOfMemoryError``), lags or inconsistencies.\n+\n+\n+Storing References\n+~~~~~~~~~~~~~~~~~~\n+\n+Some instances such as \n+\n+* :javadoc:`DataHolder`\n+* :javadoc:`TileEntity`\n+* :javadoc:`CommandSource`\n+* :javadoc:`Entity`\n+* :javadoc:`Player`\n+* :javadoc:`Subject`\n+* :javadoc:`World`\n+* and containers that **MIGHT** contain any of the above elements, including\n+    * ``Collections``\n+    * ``Maps``\n+\n+should **NEVER** be stored or be cached in plugins.\n+\n+These are the main reasons for this:\n+\n+* The references prevent proper garbage collection\n+* The instances might no longer be valid\n+\n+This can easily be avoided by using the corresponding snapshots or saving the UUID of given the instances and request a\n+live instance when you need it.\n+\n+\n+IO on the main thread\n+~~~~~~~~~~~~~~~~~~~~~\n+\n+Executing some IO operations such as loading a config/data file or checking for updates/connecting to a website takes\n+much time and greatly affects the TPS on the server. Such tasks should be either done in their own threads or using the","path":"source/plugin/practices.rst","position":59,"original_position":59,"commit_id":"621d9f256374d3c632b287c05acf956cfae4ec4d","original_commit_id":"621d9f256374d3c632b287c05acf956cfae4ec4d","user":{"login":"Inscrutable","id":1009532,"avatar_url":"https://avatars.githubusercontent.com/u/1009532?v=3","gravatar_id":"","url":"https://api.github.com/users/Inscrutable","html_url":"https://github.com/Inscrutable","followers_url":"https://api.github.com/users/Inscrutable/followers","following_url":"https://api.github.com/users/Inscrutable/following{/other_user}","gists_url":"https://api.github.com/users/Inscrutable/gists{/gist_id}","starred_url":"https://api.github.com/users/Inscrutable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Inscrutable/subscriptions","organizations_url":"https://api.github.com/users/Inscrutable/orgs","repos_url":"https://api.github.com/users/Inscrutable/repos","events_url":"https://api.github.com/users/Inscrutable/events{/privacy}","received_events_url":"https://api.github.com/users/Inscrutable/received_events","type":"User","site_admin":false},"body":"Move ``either`` ie. \"Such tasks should be done either in their own thread or ...\"\r\nI'd also like to see a comma after \"threads\".","created_at":"2016-12-20T08:30:46Z","updated_at":"2016-12-20T08:32:36Z","html_url":"https://github.com/SpongePowered/SpongeDocs/pull/558#discussion_r93189803","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments/93189803"},"html":{"href":"https://github.com/SpongePowered/SpongeDocs/pull/558#discussion_r93189803"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558","id":98657435,"html_url":"https://github.com/SpongePowered/SpongeDocs/pull/558","diff_url":"https://github.com/SpongePowered/SpongeDocs/pull/558.diff","patch_url":"https://github.com/SpongePowered/SpongeDocs/pull/558.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/558","number":558,"state":"open","locked":false,"title":"Document some bad practices that should be avoided: Fixes #541","user":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"body":"Documents the following issues new developers might make.\r\n\r\n* Storing References (https://github.com/SpongePowered/SpongeDocs/issues/541)\r\n* IO on the main thread\r\n* Accessing game objects outside the main thread","created_at":"2016-12-19T23:09:17Z","updated_at":"2016-12-20T08:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"727a01116b7926d795edbd7bdb5ede7937191d0b","assignee":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"assignees":[{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/558/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/621d9f256374d3c632b287c05acf956cfae4ec4d","head":{"label":"SpongePowered:BestPractises","ref":"BestPractises","sha":"621d9f256374d3c632b287c05acf956cfae4ec4d","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":27024702,"name":"SpongeDocs","full_name":"SpongePowered/SpongeDocs","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeDocs","description":"Documentation for Sponge and its Implementations","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeDocs","forks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/releases{/id}","deployments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/deployments","created_at":"2014-11-23T06:56:04Z","updated_at":"2016-12-07T03:49:06Z","pushed_at":"2016-12-19T23:20:10Z","git_url":"git://github.com/SpongePowered/SpongeDocs.git","ssh_url":"git@github.com:SpongePowered/SpongeDocs.git","clone_url":"https://github.com/SpongePowered/SpongeDocs.git","svn_url":"https://github.com/SpongePowered/SpongeDocs","homepage":"","size":5783,"stargazers_count":63,"watchers_count":63,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":64,"forks":68,"open_issues":64,"watchers":63,"default_branch":"master"}},"base":{"label":"SpongePowered:master","ref":"master","sha":"eb97b71a8dd0af48e3ac83f3f61ff00b7ee9ae13","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":27024702,"name":"SpongeDocs","full_name":"SpongePowered/SpongeDocs","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeDocs","description":"Documentation for Sponge and its Implementations","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeDocs","forks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/releases{/id}","deployments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/deployments","created_at":"2014-11-23T06:56:04Z","updated_at":"2016-12-07T03:49:06Z","pushed_at":"2016-12-19T23:20:10Z","git_url":"git://github.com/SpongePowered/SpongeDocs.git","ssh_url":"git@github.com:SpongePowered/SpongeDocs.git","clone_url":"https://github.com/SpongePowered/SpongeDocs.git","svn_url":"https://github.com/SpongePowered/SpongeDocs","homepage":"","size":5783,"stargazers_count":63,"watchers_count":63,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":64,"forks":68,"open_issues":64,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558"},"html":{"href":"https://github.com/SpongePowered/SpongeDocs/pull/558"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/558"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/558/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/558/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/621d9f256374d3c632b287c05acf956cfae4ec4d"}}}}
{"actor":{"display_login":"Inscrutable"}}