Newbie question: When will iPhone support GC?

Discussion in 'iOS Programming' started by jbucaran, Jun 4, 2009.

  1. jbucaran macrumors newbie


    Aug 7, 2008

    I have read that implementing GC in the iPhone would have some impact in the battery however I haven't found a complete / elaborate answer to the following question: * When will the iPhone support garbage collection?

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Thanks because there is no complete answer. Nobody really knows except maybe internally at Apple. And they're not saying. There's always the chance that GC will never be supported on the iPhone, although I'd say that pretty doubtful. But for the time being, it just isn't available. And I think, for now, it's helping to incite more efficient apps given the limited resources of the iPhone / iPod touch.
  3. admanimal macrumors 68040

    Apr 22, 2005
    Garbage collection is computationally expensive and rarely leads to memory management that is as efficient as doing it (correctly) manually. I can see them not including it for quite a while until more powerful hardware is available, and even then it might be a better idea to leave it off to avoid wasting battery life.
  4. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    In addition, garbage collection algorithms usually have very poor data cache locality, which reduces battery life even more than the time slices required would suggest.

    GC makes prototyping certain types of apps much easier for the programmer, but it generally makes apps slower and have less predictable responsiveness, as well as eating battery life. What benefits does GC provide an end user in exchange?

Share This Page