Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache hillshade textures based on texture size, not tile size. #7691

Merged
merged 1 commit into from
Dec 12, 2018

Conversation

ChrisLoer
Copy link
Contributor

@ChrisLoer ChrisLoer commented Dec 12, 2018

Fixes #7690 -- hillshade layers leak GPU memory.

I tested this manually by panning around in the hillshade.html debug page. Before the change, you can see painter._tileTextures fill up with an unbounded set of textures and watch memory use grow. After the change, memory use stabilizes after panning around for a while, and you can watch textures getting re-used in Painter#getTileTexture.

@mollymerp it doesn't look to me like native has the same problem, but not sure if the logic could be hidden somewhere else -- does that sound right to you?

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

Fixes #7690 -- hillshade layers leak GPU memory.
Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for tracking this down! yep I double checked and native does not have the same issue.

@ChrisLoer ChrisLoer merged commit 83a9b53 into master Dec 12, 2018
@ChrisLoer ChrisLoer deleted the leaky-hillshades branch December 12, 2018 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants