I am at the final stage of my Social App. Which is database driven. It pulls data from my server.
I get current number of user pages from the database, then i use that number to pull that last page with 10 users. Then i give the the option to load more users by showing a button.
Now if the the button is pressed it loads more users, i basically decrease the number of page i am currently at, then load 10 more users.
Right at the second time of pressing the load more users button, i get a memory warning. Then each click of the button gets memory warning. At the 4th time, the App crashes!
When a use is loaded, i get his picture from the database, his info, like name and age and so forth and display it as a new instantiated GameObect that carries a UITextue and some UILabels.
Not sure what am i doing wrong!
Have you tried using the Memory section of the Profiler?
Yeah, i did.
I think mobile devices can’t handle too many GameObjects with textures and data.
So i had to destroy the loaded 10 users and load new ones every-time the load more button is clicked.
I will give it a try and see if that helps.
Just a quick question, is SendMessage with method name to a GameObject better or get the component of the GameObject and then calling it’s methods better for performance??
hmmmm just tried removing the loaded users and load 10 more each time, seems to be worse, 8 memory warnings and then crash!
Strange, i thought i had the solution!
I think i figured out what’s going on.
Even though i went to only one user loaded each time, the App still crashed with memory warnings.
It never did that before i upgraded to Unity 5.2.3.
So i will get the new Unity 5.3 and see if that changes!
5.2.3 must have some problem managing memory!