aspose file tools*
The moose likes iOS and the fly likes How do IOS programmers handle the lack of garbage collection in IOS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » iOS
Bookmark "How do IOS programmers handle the lack of garbage collection in IOS?" Watch "How do IOS programmers handle the lack of garbage collection in IOS?" New topic
Author

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

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4658
    
    5

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?
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

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.
nik gen
Greenhorn

Joined: Mar 24, 2008
Posts: 12
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.
Raja Pal
Ranch Hand

Joined: Jul 12, 2004
Posts: 92
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.


Java Pal - Your friend in technology and innovation...India.
nik gen
Greenhorn

Joined: Mar 24, 2008
Posts: 12
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How do IOS programmers handle the lack of garbage collection in IOS?