Xcode garbage collection?

Community Forums/Monkey Talk/Xcode garbage collection?

Pete Carter(Posted 2011) [#1]
I see that Monkey has garbage collection, how is this handled on the iphone as last time I did anything on the iphone it didn't support garbage collection you used to have to write your own clean up code.


Jesse(Posted 2011) [#2]
garbage collectors are what I would call a blessing and a curse simply because an unmanaged garbage collector can under certain conditions bring your program to a crawl. some instances it can cause a program to jitter. it's the same for all languages while the speed of the process may at time make it seem as if it is not intrusive, other times it makes you hate it.

all garbage collectors work on the same principle, all keep track of references and delete the object when there are no more references to it. personally I don't know if Mark designed it himself for monkey or is part of javascript, java and/or xcode but I believe it is integrated in Javascript and Java. He might have had to implement it in xcode but I don't really know.

anyway, because of the speed of the iphone processor(slow compared to a full desktop processor), it will effect performance based on how you use it more than a on a desktop. if you are constantly creating and deleting objects you will see a lot of jittering and or slowdown.

There are a few post in the Monkeycoder website that discuss that. Not one in particular for Iphone but trust me they all have the same issues when it comes the garbage collector. he might be using the same one he used for Blitzmax.

sooner or later we all need to recycle :).

Last edited 2011


Brucey(Posted 2011) [#3]
iOS 5 has ARC. I suggest that is the way to go if you don't want to manage your own objects.


N(Posted 2011) [#4]
I love ARC, it is made of happiness and awesome.


therevills(Posted 2011) [#5]
The Australian Research Council ??? :P

http://developer.apple.com/technologies/ios5/

Last edited 2011


ziggy(Posted 2011) [#6]
How does ARC differe from regular ref counting garbage collectors? Is it built in to LLVM?


N(Posted 2011) [#7]
.

Last edited 2012