google-maps-ios-utils
google-maps-ios-utils copied to clipboard
Reached the max number of texture atlases, can not allocate more.
Hello I am using Google Maps SDK to display list of places using GMSGrounOverlay as markers. Each marker has images coming from backend. While image is being downloaded, I am using a placeholder icon and then once image download has completed, the rounded image will replace placeholder.
It was working fine but now I am starting to encounter crash while loading map markers with images.
Crash occurs with message Reached the max number of texture atlases, cannot allocate more.
0x100f536bc <+0>: sub sp, sp, #0x40 ; =0x40
0x100f536c0 <+4>: stp x22, x21, [sp, #0x10]
0x100f536c4 <+8>: stp x20, x19, [sp, #0x20]
0x100f536c8 <+12>: stp x29, x30, [sp, #0x30]
0x100f536cc <+16>: add x29, sp, #0x30 ; =0x30
0x100f536d0 <+20>: mov x20, x1
0x100f536d4 <+24>: mov x19, x0
0x100f536d8 <+28>: bl 0x100d653ec ; gmscore::base::ReferenceCounted::ReferenceCounted()
0x100f536dc <+32>: adrp x8, 1874
0x100f536e0 <+36>: ldr x8, [x8, #0xb78]
0x100f536e4 <+40>: add x8, x8, #0x10 ; =0x10
0x100f536e8 <+44>: str x8, [x0]
0x100f536ec <+48>: ldr x8, [x20]
-> 0x100f536f0 <+52>: ldr x21, [x8, #0x40]
0x100f536f4 <+56>: str x21, [sp, #0x8]
0x100f536f8 <+60>: cbz x21, 0x100f53708 ; <+76>
0x100f536fc <+64>: mov x0, x21
0x100f53700 <+68>: bl 0x100d65440 ; gmscore::base::ReferenceCounted::Ref()
0x100f53704 <+72>: ldr x21, [sp, #0x8]
0x100f53708 <+76>: add x0, sp, #0x8 ; =0x8
0x100f5370c <+80>: bl 0x100ed8158 ; gmscore::base::reffed_ptrgmscore::renderer::TextureState::~reffed_ptr()
0x100f53710 <+84>: str x21, [x19, #0x10]
0x100f53714 <+88>: ldr x0, [x20]
0x100f53718 <+92>: str x0, [x19, #0x18]
0x100f5371c <+96>: cbz x0, 0x100f53724 ; <+104>
0x100f53720 <+100>: bl 0x100d65440 ; gmscore::base::ReferenceCounted::Ref()
0x100f53724 <+104>: mov x0, x19
0x100f53728 <+108>: ldp x29, x30, [sp, #0x30]
0x100f5372c <+112>: ldp x20, x19, [sp, #0x20]
0x100f53730 <+116>: ldp x22, x21, [sp, #0x10]
0x100f53734 <+120>: add sp, sp, #0x40 ; =0x40
0x100f53738 <+124>: ret
0x100f5373c <+128>: b 0x100f53740 ; <+132>
0x100f53740 <+132>: mov x20, x0
0x100f53744 <+136>: mov x0, x19
0x100f53748 <+140>: bl 0x100d6541c ; gmscore::base::ReferenceCounted::~ReferenceCounted()
0x100f5374c <+144>: mov x0, x20
0x100f53750 <+148>: bl 0x101399af4 ; symbol stub for: _Unwind_Resume
0x100f53754 <+152>: brk #0x1
Does each marker have a unique image? If not, our docs recommend the following:
If you are creating several markers with the same image, use the same instance of UIImage for each of the markers. This helps improve the performance of your application when displaying many markers.
@arriolac yes most of them have unique image (profile pictures)...when they have common image, I have used same instance. But still its crashing
@arriolac By the way, images are coming from server....how do you suggest to manage such images? I did not find any resources for these scenarios in your documentations.
If images are coming from a server, keep a shared instance of each image, perhaps by key. That is, ensure you are not re-allocating images for multiple markers.
I am coming back to this question. What is the max number of textures? In our case, we have 300-500 unique marker images that needs to stay that way. Is there anything we could do to omit this when we need unique markers?