• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do IOS programmers handle the lack of garbage collection in IOS?

 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From my dabbling and learning IOS development, the biggest problem that I expect my code will have is memory leaks. I can understand that as a very limited embedded computer, its an engineering tradeoff of features vs memory/time/code/bugs/... but the idea of a programmer managing his own memory makes me shudder.

How do folks really handle this?
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Memory management in iOS isn't that bad or difficult, retain and release policy is really clear. Maybe we are spoiled by garbage collected languages.
All you need are three or four rules when it comes to memory management, crystal clear.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can found and solve your memory leaks using Static Analyzers and with Instrument tools.
Using Build and Static Analyze, you will get all the possible leaks in your code at compile time.
Using Instrument tools, you can find run time leaks. These are very useful to handle memory management.

Thanks,
Niketa.
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With the iOS 5 you can handle garbage collection by exploiting features like Automatic Reference Counting - ARC which allows you to track the reference count of variables and thus collect them.
 
nik gen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raja,

Thats a good features in iOS 5.
But in lower versions as well as in iOS 5, the build and analyze and Instrument tool is very useful. ARC is one more feature to handle memory after iOS 5.

Thanks,
Niketa.
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic