{"action":"created","issue":{"url":"https://api.github.com/repos/citra-emu/citra/issues/1503","repository_url":"https://api.github.com/repos/citra-emu/citra","labels_url":"https://api.github.com/repos/citra-emu/citra/issues/1503/labels{/name}","comments_url":"https://api.github.com/repos/citra-emu/citra/issues/1503/comments","events_url":"https://api.github.com/repos/citra-emu/citra/issues/1503/events","html_url":"https://github.com/citra-emu/citra/pull/1503","id":140401059,"number":1503,"title":"Clear JIT cache","user":{"login":"bunnei","id":6956688,"avatar_url":"https://avatars.githubusercontent.com/u/6956688?v=3","gravatar_id":"","url":"https://api.github.com/users/bunnei","html_url":"https://github.com/bunnei","followers_url":"https://api.github.com/users/bunnei/followers","following_url":"https://api.github.com/users/bunnei/following{/other_user}","gists_url":"https://api.github.com/users/bunnei/gists{/gist_id}","starred_url":"https://api.github.com/users/bunnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunnei/subscriptions","organizations_url":"https://api.github.com/users/bunnei/orgs","repos_url":"https://api.github.com/users/bunnei/repos","events_url":"https://api.github.com/users/bunnei/events{/privacy}","received_events_url":"https://api.github.com/users/bunnei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-12T17:22:14Z","updated_at":"2016-03-12T17:53:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/1503","html_url":"https://github.com/citra-emu/citra/pull/1503","diff_url":"https://github.com/citra-emu/citra/pull/1503.diff","patch_url":"https://github.com/citra-emu/citra/pull/1503.patch"},"body":"Adds a check to ensure the memory allocated for cached compiled shaders is not full. If so, it clears the cache and frees up the memory to be used for new shaders. I also bumped the size up to 8MB to make this happen less frequently (although it was already pretty infrequent).\r\n\r\nAlso, we should have _at least_ been doing this between each game before, so you'd eventually hit this issue just by playing a few different games in a row.\r\n\r\nFixes #1443\r\nFixes #1081 \r\nFixes #1127"},"comment":{"url":"https://api.github.com/repos/citra-emu/citra/issues/comments/195780533","html_url":"https://github.com/citra-emu/citra/pull/1503#issuecomment-195780533","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/1503","id":195780533,"user":{"login":"bunnei","id":6956688,"avatar_url":"https://avatars.githubusercontent.com/u/6956688?v=3","gravatar_id":"","url":"https://api.github.com/users/bunnei","html_url":"https://github.com/bunnei","followers_url":"https://api.github.com/users/bunnei/followers","following_url":"https://api.github.com/users/bunnei/following{/other_user}","gists_url":"https://api.github.com/users/bunnei/gists{/gist_id}","starred_url":"https://api.github.com/users/bunnei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunnei/subscriptions","organizations_url":"https://api.github.com/users/bunnei/orgs","repos_url":"https://api.github.com/users/bunnei/repos","events_url":"https://api.github.com/users/bunnei/events{/privacy}","received_events_url":"https://api.github.com/users/bunnei/received_events","type":"User","site_admin":false},"created_at":"2016-03-12T17:53:12Z","updated_at":"2016-03-12T17:53:12Z","body":"@yuriks not what you suggested in #1081, but:\r\n* Cache clearing happens very infrequently (like once every few minutes on a few games, never on most), and it's unnoticeable (at least to me) when it happens\r\n* Allocating blocks separately for each shader would mean we need to allocate the maximum size of for each shader, which can be huge (the way the JIT currently works, anyway). Having just one big block means each shader uses only the amount of memory that it needs.\r\n* Doing it the other way, some games might end up leaking a ton of memory, so we'd need to keep track of and free stale shaders... Just seems like a lot of extra management for something that doesn't seem necessary.\r\n* It seems to me that the emitter (and specifically XCodeBlock) were not really intended to be used this way (allocating new memory for each block you're compiling), although perhaps it still would be fine... This approach just seemed much easier and sufficient IMO\r\n"}}