Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Raster/TexturePoolHolder leaks textures #5136

Closed

Description

@jonkan

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).

Trying 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;.
There's also the line if (bool()) return; which to me seems to have no purpose?
Or am I missing something?

I can also add that, with those lines removed TexturePoolHolder::reset() seems to always be called having a NULL objectStore when called from Raster::~Raster()...

Activity

  1. jfirebaugh commented on May 25, 2016

    @jfirebaugh
    Contributor

    if (bool()) originates in 1241730 -- cc @brunoabinader.

  2. added
    performance
    on May 25, 2016
  3. jonkan commented on May 25, 2016

    @jonkan
    Author

    Tested with latest master now and the crashes are easily reproducible with the "iosapp"-target and the default "Satellite"-style by constantly panning in one direction, takes a while though..

    screen shot 2016-05-25 at 20 04 03

  4. brunoabinader commented on May 25, 2016

    @brunoabinader
    Contributor

    There's also the line if (bool()) return; which to me seems to have no purpose? Or am I missing something?

    Oh my, this looks like my eyes missed this while batch replacing strings on my IDE. Will send a patch soon.

  5. added
    Core
    on May 25, 2016
  6. brunoabinader commented on May 25, 2016

    @brunoabinader
    Contributor
  7. jonkan commented on May 25, 2016

    @jonkan
    Author

    Oh, that I'd missed.. I tested again with a clean master (as I had commented out just that line last time) and the memory-leak/crashing is still there.

  8. added a commit that references this issue on May 25, 2016
    a4234f1
  9. brunoabinader commented on May 25, 2016

    @brunoabinader
    Contributor

    @jonkan can you please verify the patches from #5141?

  10. jonkan commented on May 26, 2016

    @jonkan
    Author

    @jonkan can you please verify the patches from #5141?

    👍 For the purpose of readability if (!created()) return; is more clear to me than if (!bool()) return;, not sure I understand if the PR was intended to fix more than just the readability aspect. The memory-leaking/crashing is still present, but might have its cause somewhere else..

  11. brunoabinader commented on May 26, 2016

    @brunoabinader
    Contributor

    Reopening for verification - @jonkan can you please verify?

  12. friedbunny commented on May 26, 2016

    @friedbunny
    Contributor

    We will want to include an iOS changelog entry for this fix, as it affected iOS 3.2.x.

    Android 4.0.x is also affected, but I’m not sure if 4.1.0 will include this? /cc @bleege

  13. bleege commented on May 26, 2016

    @bleege
    Contributor

    @friedbunny Thanks for the ping. I branched 4.1.0-beta.1 off of 26a425f before the final two commits ( b2b2797 and c111250 ) had been pushed to master. We'll have to cherry pick them to the release-android-v4.1.0 branch when it's been verified and @brunoabinader closes this issue.

    /cc @tobrun @cammace

  14. jonkan commented on May 26, 2016

    @jonkan
    Author

    @brunoabinader Awesome! That solved it, not seeing any crashes or leaks. 👍

  15. brunoabinader commented on May 27, 2016

    @brunoabinader
    Contributor

    Thank you @jonkan!

  16. bleege commented on May 27, 2016

    @bleege
    Contributor

    Thanks for confirming and getting this fixed @jonkan @brunoabinader. I'll cherry pick the remaining two commits into the release-android-v4.1.0 branch now so that they'll ship with future 4.1.0 builds and releases.

  17. brunoabinader commented on May 27, 2016

    @brunoabinader
    Contributor

    Awesome @bleege, thanks!

  18. added a commit that references this issue on May 27, 2016
    af34481
  19. bleege commented on May 27, 2016

    @bleege
    Contributor

    Cherries have been picked!

    screen shot 2016-05-27 at 10 43 22 am

  20. added this to the android-v4.1.0 milestone on May 27, 2016
  21. friedbunny commented on May 27, 2016

    @friedbunny
    Contributor

    Updated the iOS changelog in 2f25c1a — this issue will be fixed in the v3.3.0 release (and whichever pre-release comes after alpha 3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corebugperformance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions