{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5136","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5136/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5136/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5136/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/5136","id":156805383,"number":5136,"title":"Raster/TexturePoolHolder leaks textures","user":{"login":"jonkan","id":3512794,"avatar_url":"https://avatars.githubusercontent.com/u/3512794?v=3","gravatar_id":"","url":"https://api.github.com/users/jonkan","html_url":"https://github.com/jonkan","followers_url":"https://api.github.com/users/jonkan/followers","following_url":"https://api.github.com/users/jonkan/following{/other_user}","gists_url":"https://api.github.com/users/jonkan/gists{/gist_id}","starred_url":"https://api.github.com/users/jonkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonkan/subscriptions","organizations_url":"https://api.github.com/users/jonkan/orgs","repos_url":"https://api.github.com/users/jonkan/repos","events_url":"https://api.github.com/users/jonkan/events{/privacy}","received_events_url":"https://api.github.com/users/jonkan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/Core%20GL","name":"Core GL","color":"b60205"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/performance","name":"performance","color":"33aa33"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-05-25T17:22:20Z","updated_at":"2016-05-26T19:03:34Z","closed_at":null,"body":"We're seeing a lot of \"out of memory\"-crashes after a while of heavy panning (iPad Air 2, a raster only stylesheet containing two raster-layers, both using 1024px tiles). \r\n\r\nTrying to track down what's eating all the memory I found that in gl_object_store.cpp, `TexturePoolHolder::reset()` it seems textures are never deleted due to the line [`if (!bool()) return;`](https://github.com/mapbox/mapbox-gl-native/blob/master/src/mbgl/gl/gl_object_store.cpp#L63).\r\nThere's also the line [`if (bool()) return;`](https://github.com/mapbox/mapbox-gl-native/blob/master/src/mbgl/gl/gl_object_store.cpp#L57) which to me seems to have no purpose?\r\nOr am I missing something?\r\n\r\nI can also add that, with those lines removed `TexturePoolHolder::reset()` seems to always be called having a NULL `objectStore` when called from [`Raster::~Raster()`](https://github.com/mapbox/mapbox-gl-native/blob/master/src/mbgl/util/raster.cpp#L18)..."},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/221964097","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/5136#issuecomment-221964097","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5136","id":221964097,"user":{"login":"bleege","id":989928,"avatar_url":"https://avatars.githubusercontent.com/u/989928?v=3","gravatar_id":"","url":"https://api.github.com/users/bleege","html_url":"https://github.com/bleege","followers_url":"https://api.github.com/users/bleege/followers","following_url":"https://api.github.com/users/bleege/following{/other_user}","gists_url":"https://api.github.com/users/bleege/gists{/gist_id}","starred_url":"https://api.github.com/users/bleege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleege/subscriptions","organizations_url":"https://api.github.com/users/bleege/orgs","repos_url":"https://api.github.com/users/bleege/repos","events_url":"https://api.github.com/users/bleege/events{/privacy}","received_events_url":"https://api.github.com/users/bleege/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T19:03:34Z","updated_at":"2016-05-26T19:03:34Z","body":"@friedbunny Thanks for the ping.  I branched `4.1.0-beta.1` off of 26a425fa6d0386aa59027b1b5813edd781f460ed before the final two commits ( b2b2797c2a30b8085683935d760c45284c639e96 and c111250fcccaf5e57154852606ee740f0db242c1 ) had been pushed to `master`.  We'll have to cherry pick them to the [`release-android-v4.1.0`](https://github.com/mapbox/mapbox-gl-native/commits/release-android-v4.1.0) branch when it's been verified and @brunoabinader closes this issue.\r\n\r\n/cc @tobrun @cammace\r\n\r\n"}}
{"actor":{"display_login":"bleege"}}