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

Fixed memory usage high in some cases #2442

Merged
merged 3 commits into from
May 29, 2024

Conversation

alexcristici
Copy link
Collaborator

@alexcristici alexcristici commented May 28, 2024

Fixed metal rendering when presentsWithTransaction is enabled, based on Apple documentation:
Setting this value to YES makes the layer draw its contents synchronously, using whichever Core Animation transaction is current at the time you call the drawable’s present method. To ensure that a transaction is available when you schedule the drawable to be presented, first commit the command buffer containing your Metal rendering commands. Then, call its waitUntilScheduled method to synchronously wait until the command queue schedules the command buffer to execute on the GPU. Finally, call the drawable’s present method.
Source: https://developer.apple.com/documentation/quartzcore/cametallayer/1478157-presentswithtransaction?language=objc.

This will fix correctly also the following issues: #2337, #2380, #2053, so I removed old hacks.

Allocations after the fix:

Screen.Recording.2024-05-28.at.22.13.31.mov

@alexcristici alexcristici self-assigned this May 28, 2024
@alexcristici alexcristici linked an issue May 28, 2024 that may be closed by this pull request
@alexcristici alexcristici marked this pull request as ready for review May 28, 2024 19:19
Copy link

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0%    -416  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2442-compared-to-main.txt

platform/ios/src/MLNMapView.mm Show resolved Hide resolved
@louwers louwers added bug Something isn't working iOS labels May 28, 2024
@louwers
Copy link
Collaborator

louwers commented May 28, 2024

Nice! I can make a release when this is merged.

@alexcristici alexcristici merged commit 9c6ba69 into maplibre:main May 29, 2024
19 checks passed
louwers pushed a commit that referenced this pull request May 29, 2024
@alexcristici alexcristici deleted the memory-usage-high-fix branch May 30, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Memory usage high in some cases
4 participants