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

Bugfix/unmount memory leak #3708

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

g4rb4g3
Copy link
Contributor

@g4rb4g3 g4rb4g3 commented Dec 1, 2024

Description

Fixes an issue that memory would not be freed up when the MapView was unmounted on iOS.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new bugfix on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Screenshot OR Video

without this memory consumption increases whenever a new MapView is mounted
Bildschirmfoto 2024-11-29 um 13 01 16

with this fix memory is freed up when a MapView is unmounted
Bildschirmfoto 2024-12-01 um 15 31 35

Component to reproduce the issue you're fixing

I've updated the ShowMap.tsx and added an (un)mount button there. Whenever you press this button and a MapView is mounted memory usage increases but never decreases when unmounting unless this fix is in place.

@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3 g4rb4g3 requested a deployment to CI with Mapbox Tokens December 1, 2024 15:44 — with GitHub Actions Waiting
@g4rb4g3
Copy link
Contributor Author

g4rb4g3 commented Dec 1, 2024

I just double checked on Android and it seems like this is an iOS issue only.
Whenever the map is unmounted the memory consumption goes down and raises again when the map is mounted again.
image

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.

1 participant