Skip to content

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

Merged
ChrisLoer merged 1 commit into
masterfrom
leaky-hillshades
Dec 12, 2018
Merged

ChrisLoer merged 1 commit into
masterfrom
leaky-hillshades

Conversation

@ChrisLoer

@ChrisLoer ChrisLoer commented Dec 12, 2018 •

Copy link
Copy Markdown
Contributor

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.

@mollymerp mollymerp left a comment

Copy link
Copy Markdown
Contributor

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