Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

App Crashes. How improve stability of iPhone Apps?

Hello all,

I have some issues with the stability of my titanium iphone app. It crashes randomly. But i can´t reproduce the crashes in detail. But the crashes mostly occur when using a slider that causes many labels to change its values. Also when scrolling in a table view where each row contains controls and labels. Each row can be added dynamically. And writing/reading to/from the memory of the iphone via Titanium.App.Properties.setList are the most commen tasks in my application.

Are there any tips in general how to avoid the crashes? It sounds to me like memory leak issues, because the crashes occur randomly. Can I do some memory management in my app? Is there a Garbage Collection in Titanium?

It it important to fix this javascript warnings? 'functionname' was used before it was defined.

many thx for your help,

— asked April 22nd 2010 by florian spier
  • crash
  • iphone
  • memory

5 Answers

  • Hi Florian,

    I have the same problem with (customized) table views.

    I also noticed that if a window is being closed, children of that window are not being destroyed…

    I hope that you get a answer…

    — answered April 22nd 2010 by Otacon Overdrive
  • Hi

    For custom tableviews, are you sure you set the className ? this is very important, and is telling the OS to render the rows using the same template for the same type of rows, to improve the memory and cpu usage.

    — answered April 22nd 2010 by Dan Tamas
  • hey Tamas,

    you mean every row that has the same structure should have the same className? that would be a good point! i have a lot of tables and rows…

    many thx,

    — answered April 22nd 2010 by florian spier
  • I also see some crashes in my table rows but when I give each of them a unique classname, even all of them have same layout and structure, it became more stable…. kind of opposite of what Tamas said…. I wonder why?

    — answered April 23rd 2010 by Peter Lum
  • Hello, the className hint helped a lot. The app is much more stable now. I used same className for rows that have the same layout. But sometimes crashes still occur. My application is tab-based. In 2 tabs i have basically table views with many rows and hasChild true. Sometimes you must click "back" 5 times to arrive at the top level table view again. I guess all top windows then are still in memory. Perhaps it could be a good idea to navigate back to top level table view to make the children ready for "garbage collection". Or just create the tab windows when they are needed. I will give it a try. thx, florian

    — answered April 23rd 2010 by florian spier
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.