Titanium Community Questions & Answer Archive

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

Memory leak in 'clock' function?

I have a clock function to set and display current UK time. It's updated every second from a pretty standard piece of Date Object voodoo driven by setInterval(myClock, 1000);

Using XCode's 'Instruments' to check leaks we appear to be chewing though 2.57MB of memory in a run of two hours.

If I disable the clock loop the leak goes away. So my question is

1) If I am overwriting the same global variable in the clock function every second (which is used to expose the adjusted Date Object to the rest of the app) where is the leak coming from?

2) Should I worry about this or does Mr Garbage man come round and clean up later?

— asked September 29th 2010 by Patrick Mounteney
  • iphone
  • memory
  • mobile
0 Comments

0 Answers

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.