{"action":"closed","number":9,"pull_request":{"url":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/9","id":49819336,"html_url":"https://github.com/Thepagedot/IRMGARD/pull/9","diff_url":"https://github.com/Thepagedot/IRMGARD/pull/9.diff","patch_url":"https://github.com/Thepagedot/IRMGARD/pull/9.patch","issue_url":"https://api.github.com/repos/Thepagedot/IRMGARD/issues/9","number":9,"state":"closed","locked":false,"title":"A bitmap loader component to keep bitmap memory consumption on a low level","user":{"login":"fawuser","id":10966790,"avatar_url":"https://avatars.githubusercontent.com/u/10966790?v=3","gravatar_id":"","url":"https://api.github.com/users/fawuser","html_url":"https://github.com/fawuser","followers_url":"https://api.github.com/users/fawuser/followers","following_url":"https://api.github.com/users/fawuser/following{/other_user}","gists_url":"https://api.github.com/users/fawuser/gists{/gist_id}","starred_url":"https://api.github.com/users/fawuser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fawuser/subscriptions","organizations_url":"https://api.github.com/users/fawuser/orgs","repos_url":"https://api.github.com/users/fawuser/repos","events_url":"https://api.github.com/users/fawuser/events{/privacy}","received_events_url":"https://api.github.com/users/fawuser/received_events","type":"User","site_admin":false},"body":"Ok - this is what I'm trying to accomplish with the new component `BitmapLoader`... :grin:\r\n\r\n## Background\r\nEach educational image (in folder `Images`) allocates approx. 4 MB of JVM heap space. Frequent calls to GC to release the bitmap memory might have a negative impact on app performance.\r\nThe BitmapLoader component tries to fix that by reusing the allocated heap space of each bitmap loaded in the previous iteration. So there is no need for GC to become active. This works because all images in \"`Images`\" are equal in size.\r\n\r\nE.g. \"Four Pictures\" uses 16 MB of heap memory for each iteration. To invoke GC to dispose that amount of heap memory after each iteration wouldn't be as practical as reusing that space for the next four images to load. So each lesson uses only as much heap space as the maximum number of images per iteration.\r\n\r\n## Usage\r\n`BitmapLoader` is created as a singleton and manages a pool of `BitmapFactory.Options` items. To load an image using `BitmapLoader` you choose an arbitrary index value for `imgIdx`. `imgIdx` references a `BitmapFactory.Options` item in the pool. If `imgIdx` is pointing to a non-existing position - the pool creates new instances of `BitmapFactory.Options` items up to this position (`CheckAddItems()`). If this instance - `imgIdx` is pointing to - is never used before, it will be initialized with the dimensions of the image to load. This actually allocates the memory for the current image. Afterwards the bitmap is decoded into the pre-allocated memory and returned as an object of type `Bitmap`.\r\n\r\nIn the next iteration if `BitmapLoader` is presented with the same value of `imgIdx` and `BitmapLoader.ReleaseCache()` has not been called the next bitmap will reuse this allocated space.\r\n\r\nThe best time to invoke `BitmapLoader.ReleaseCache()` to dispose Bitmap instances of all `BitmapFactory.Options` items is at the end of each lesson if the following lesson won't use as much images as the lesson before.","created_at":"2015-11-05T12:46:00Z","updated_at":"2015-11-10T13:52:19Z","closed_at":"2015-11-10T13:52:19Z","merged_at":"2015-11-10T13:52:19Z","merge_commit_sha":"ac14330421fdbb7d65fdf69abae1fb80931a81e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Thepagedot/IRMGARD/issues/9/comments","statuses_url":"https://api.github.com/repos/Thepagedot/IRMGARD/statuses/07ac014f0200b9b7f0bbc1669fef686577a1e4eb","head":{"label":"fawuser:feature/bitmaploader","ref":"feature/bitmaploader","sha":"07ac014f0200b9b7f0bbc1669fef686577a1e4eb","user":{"login":"fawuser","id":10966790,"avatar_url":"https://avatars.githubusercontent.com/u/10966790?v=3","gravatar_id":"","url":"https://api.github.com/users/fawuser","html_url":"https://github.com/fawuser","followers_url":"https://api.github.com/users/fawuser/followers","following_url":"https://api.github.com/users/fawuser/following{/other_user}","gists_url":"https://api.github.com/users/fawuser/gists{/gist_id}","starred_url":"https://api.github.com/users/fawuser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fawuser/subscriptions","organizations_url":"https://api.github.com/users/fawuser/orgs","repos_url":"https://api.github.com/users/fawuser/repos","events_url":"https://api.github.com/users/fawuser/events{/privacy}","received_events_url":"https://api.github.com/users/fawuser/received_events","type":"User","site_admin":false},"repo":{"id":45601566,"name":"IRMGARD","full_name":"fawuser/IRMGARD","owner":{"login":"fawuser","id":10966790,"avatar_url":"https://avatars.githubusercontent.com/u/10966790?v=3","gravatar_id":"","url":"https://api.github.com/users/fawuser","html_url":"https://github.com/fawuser","followers_url":"https://api.github.com/users/fawuser/followers","following_url":"https://api.github.com/users/fawuser/following{/other_user}","gists_url":"https://api.github.com/users/fawuser/gists{/gist_id}","starred_url":"https://api.github.com/users/fawuser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fawuser/subscriptions","organizations_url":"https://api.github.com/users/fawuser/orgs","repos_url":"https://api.github.com/users/fawuser/repos","events_url":"https://api.github.com/users/fawuser/events{/privacy}","received_events_url":"https://api.github.com/users/fawuser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fawuser/IRMGARD","description":"Mit IRMGARD können die Nutzer in 9 Leveln mit insgesamt über 100 Übungen ihre Lese- und Schreibkompetenz trainieren.","fork":true,"url":"https://api.github.com/repos/fawuser/IRMGARD","forks_url":"https://api.github.com/repos/fawuser/IRMGARD/forks","keys_url":"https://api.github.com/repos/fawuser/IRMGARD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fawuser/IRMGARD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fawuser/IRMGARD/teams","hooks_url":"https://api.github.com/repos/fawuser/IRMGARD/hooks","issue_events_url":"https://api.github.com/repos/fawuser/IRMGARD/issues/events{/number}","events_url":"https://api.github.com/repos/fawuser/IRMGARD/events","assignees_url":"https://api.github.com/repos/fawuser/IRMGARD/assignees{/user}","branches_url":"https://api.github.com/repos/fawuser/IRMGARD/branches{/branch}","tags_url":"https://api.github.com/repos/fawuser/IRMGARD/tags","blobs_url":"https://api.github.com/repos/fawuser/IRMGARD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fawuser/IRMGARD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fawuser/IRMGARD/git/refs{/sha}","trees_url":"https://api.github.com/repos/fawuser/IRMGARD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fawuser/IRMGARD/statuses/{sha}","languages_url":"https://api.github.com/repos/fawuser/IRMGARD/languages","stargazers_url":"https://api.github.com/repos/fawuser/IRMGARD/stargazers","contributors_url":"https://api.github.com/repos/fawuser/IRMGARD/contributors","subscribers_url":"https://api.github.com/repos/fawuser/IRMGARD/subscribers","subscription_url":"https://api.github.com/repos/fawuser/IRMGARD/subscription","commits_url":"https://api.github.com/repos/fawuser/IRMGARD/commits{/sha}","git_commits_url":"https://api.github.com/repos/fawuser/IRMGARD/git/commits{/sha}","comments_url":"https://api.github.com/repos/fawuser/IRMGARD/comments{/number}","issue_comment_url":"https://api.github.com/repos/fawuser/IRMGARD/issues/comments{/number}","contents_url":"https://api.github.com/repos/fawuser/IRMGARD/contents/{+path}","compare_url":"https://api.github.com/repos/fawuser/IRMGARD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fawuser/IRMGARD/merges","archive_url":"https://api.github.com/repos/fawuser/IRMGARD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fawuser/IRMGARD/downloads","issues_url":"https://api.github.com/repos/fawuser/IRMGARD/issues{/number}","pulls_url":"https://api.github.com/repos/fawuser/IRMGARD/pulls{/number}","milestones_url":"https://api.github.com/repos/fawuser/IRMGARD/milestones{/number}","notifications_url":"https://api.github.com/repos/fawuser/IRMGARD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fawuser/IRMGARD/labels{/name}","releases_url":"https://api.github.com/repos/fawuser/IRMGARD/releases{/id}","created_at":"2015-11-05T09:38:19Z","updated_at":"2015-11-05T09:38:22Z","pushed_at":"2015-11-05T12:13:31Z","git_url":"git://github.com/fawuser/IRMGARD.git","ssh_url":"git@github.com:fawuser/IRMGARD.git","clone_url":"https://github.com/fawuser/IRMGARD.git","svn_url":"https://github.com/fawuser/IRMGARD","homepage":"http://bit.ly/1yTf7xx","size":34898,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"Thepagedot:master","ref":"master","sha":"199eed09f03ab4aaf466e6863798e3c671b8adf8","user":{"login":"Thepagedot","id":13068921,"avatar_url":"https://avatars.githubusercontent.com/u/13068921?v=3","gravatar_id":"","url":"https://api.github.com/users/Thepagedot","html_url":"https://github.com/Thepagedot","followers_url":"https://api.github.com/users/Thepagedot/followers","following_url":"https://api.github.com/users/Thepagedot/following{/other_user}","gists_url":"https://api.github.com/users/Thepagedot/gists{/gist_id}","starred_url":"https://api.github.com/users/Thepagedot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thepagedot/subscriptions","organizations_url":"https://api.github.com/users/Thepagedot/orgs","repos_url":"https://api.github.com/users/Thepagedot/repos","events_url":"https://api.github.com/users/Thepagedot/events{/privacy}","received_events_url":"https://api.github.com/users/Thepagedot/received_events","type":"Organization","site_admin":false},"repo":{"id":38127581,"name":"IRMGARD","full_name":"Thepagedot/IRMGARD","owner":{"login":"Thepagedot","id":13068921,"avatar_url":"https://avatars.githubusercontent.com/u/13068921?v=3","gravatar_id":"","url":"https://api.github.com/users/Thepagedot","html_url":"https://github.com/Thepagedot","followers_url":"https://api.github.com/users/Thepagedot/followers","following_url":"https://api.github.com/users/Thepagedot/following{/other_user}","gists_url":"https://api.github.com/users/Thepagedot/gists{/gist_id}","starred_url":"https://api.github.com/users/Thepagedot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thepagedot/subscriptions","organizations_url":"https://api.github.com/users/Thepagedot/orgs","repos_url":"https://api.github.com/users/Thepagedot/repos","events_url":"https://api.github.com/users/Thepagedot/events{/privacy}","received_events_url":"https://api.github.com/users/Thepagedot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Thepagedot/IRMGARD","description":"Mit IRMGARD können die Nutzer in 9 Leveln mit insgesamt über 100 Übungen ihre Lese- und Schreibkompetenz trainieren.","fork":false,"url":"https://api.github.com/repos/Thepagedot/IRMGARD","forks_url":"https://api.github.com/repos/Thepagedot/IRMGARD/forks","keys_url":"https://api.github.com/repos/Thepagedot/IRMGARD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Thepagedot/IRMGARD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Thepagedot/IRMGARD/teams","hooks_url":"https://api.github.com/repos/Thepagedot/IRMGARD/hooks","issue_events_url":"https://api.github.com/repos/Thepagedot/IRMGARD/issues/events{/number}","events_url":"https://api.github.com/repos/Thepagedot/IRMGARD/events","assignees_url":"https://api.github.com/repos/Thepagedot/IRMGARD/assignees{/user}","branches_url":"https://api.github.com/repos/Thepagedot/IRMGARD/branches{/branch}","tags_url":"https://api.github.com/repos/Thepagedot/IRMGARD/tags","blobs_url":"https://api.github.com/repos/Thepagedot/IRMGARD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Thepagedot/IRMGARD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Thepagedot/IRMGARD/git/refs{/sha}","trees_url":"https://api.github.com/repos/Thepagedot/IRMGARD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Thepagedot/IRMGARD/statuses/{sha}","languages_url":"https://api.github.com/repos/Thepagedot/IRMGARD/languages","stargazers_url":"https://api.github.com/repos/Thepagedot/IRMGARD/stargazers","contributors_url":"https://api.github.com/repos/Thepagedot/IRMGARD/contributors","subscribers_url":"https://api.github.com/repos/Thepagedot/IRMGARD/subscribers","subscription_url":"https://api.github.com/repos/Thepagedot/IRMGARD/subscription","commits_url":"https://api.github.com/repos/Thepagedot/IRMGARD/commits{/sha}","git_commits_url":"https://api.github.com/repos/Thepagedot/IRMGARD/git/commits{/sha}","comments_url":"https://api.github.com/repos/Thepagedot/IRMGARD/comments{/number}","issue_comment_url":"https://api.github.com/repos/Thepagedot/IRMGARD/issues/comments{/number}","contents_url":"https://api.github.com/repos/Thepagedot/IRMGARD/contents/{+path}","compare_url":"https://api.github.com/repos/Thepagedot/IRMGARD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Thepagedot/IRMGARD/merges","archive_url":"https://api.github.com/repos/Thepagedot/IRMGARD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Thepagedot/IRMGARD/downloads","issues_url":"https://api.github.com/repos/Thepagedot/IRMGARD/issues{/number}","pulls_url":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls{/number}","milestones_url":"https://api.github.com/repos/Thepagedot/IRMGARD/milestones{/number}","notifications_url":"https://api.github.com/repos/Thepagedot/IRMGARD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Thepagedot/IRMGARD/labels{/name}","releases_url":"https://api.github.com/repos/Thepagedot/IRMGARD/releases{/id}","created_at":"2015-06-26T18:39:46Z","updated_at":"2015-11-05T09:37:04Z","pushed_at":"2015-11-10T13:52:19Z","git_url":"git://github.com/Thepagedot/IRMGARD.git","ssh_url":"git@github.com:Thepagedot/IRMGARD.git","clone_url":"https://github.com/Thepagedot/IRMGARD.git","svn_url":"https://github.com/Thepagedot/IRMGARD","homepage":"http://bit.ly/1yTf7xx","size":35616,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/9"},"html":{"href":"https://github.com/Thepagedot/IRMGARD/pull/9"},"issue":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/issues/9"},"comments":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Thepagedot/IRMGARD/statuses/07ac014f0200b9b7f0bbc1669fef686577a1e4eb"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"einRobby","id":5874465,"avatar_url":"https://avatars.githubusercontent.com/u/5874465?v=3","gravatar_id":"","url":"https://api.github.com/users/einRobby","html_url":"https://github.com/einRobby","followers_url":"https://api.github.com/users/einRobby/followers","following_url":"https://api.github.com/users/einRobby/following{/other_user}","gists_url":"https://api.github.com/users/einRobby/gists{/gist_id}","starred_url":"https://api.github.com/users/einRobby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/einRobby/subscriptions","organizations_url":"https://api.github.com/users/einRobby/orgs","repos_url":"https://api.github.com/users/einRobby/repos","events_url":"https://api.github.com/users/einRobby/events{/privacy}","received_events_url":"https://api.github.com/users/einRobby/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":276,"deletions":16,"changed_files":9}}