I’ve noticed the memory taken by the Google map is quite high, I have it on a tab in a tabnav. My question is, is it a good idea to hide the map when you leave the tab (to free up some memory) and then reinitialize it when you come back? Or is it best to just leave it running?
Share
In previous projects I have initialised any component inside viewdidload (checking for already being initialised since it can be called more than once), then inside the viewwillappear doing the same check (as swapping tabs may/probably won’t call viewdidload again, and the component may have be deallocated by the code below) then finally inside:
I will deallocate / nil any properties that can be disposed of incase the OS decides its low on memory.. Personally I wouldn’t bother clearing the google maps out of memory since they take time to initialise so if the OS doesn’t have to clear them, it won’t slow down your app.