-
Notifications
You must be signed in to change notification settings - Fork 133
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
MapboxTextureViewRenderer Memory Leak #2463
Comments
Could you please clarify and share a snippet of what's inside |
Hi, sorry for the late answer, I was on holidays. Here is our codesnipped RouteViewHolder:
|
Here mapInitOptions:
|
@SigmaAppdevelopment thank you for the snippets. Line 83 in 2de0b30
I tried to replicate your example but still can't reproduce the memory leak. It would be great if you could prepare a sample app that reproduces the issue. |
hi @flasher297 Calling onStop solved the issue, but there was a new problem: when scrolling up again map was gone. So we needed to initialize it again, and that was bad performance. Because we needed a solution, I found another one. Snapshotter. The fragment holds one instance of Snapshotter and a queue of snapshot requests. The view holders sends a request to Snapshotter on bind and receives asynchronous callback when snapshot is ready. So recycler view shows a list of bitmaps, not a list of maps. Finally no leak, problem solved. |
Nice to hear it and thank you for the feedback. |
Environment
Observed behavior and steps to reproduce
I want to show a list of routes with preview. therefore I'm using a mapview inside a recyclerview.
If the fragment is stopped, I detach adapter from recycler view.
But there is stell a memory leak with MapboxTextureViewRenderer. If I set mapsurface to surfaceView, there is no leak
Expected behavior
No Leak
The text was updated successfully, but these errors were encountered: