Team Murder No Brain No Headache.


Memory Management Seems Weird At This Point

Maybe I've spent too many hours logging though reams of code in interpreted languages (I guess that would be 'scripting' or 'not real' to all of the purists out there) but handling memory management in a language that isn't good old fashioned C where deallocation is just a 'release' away just seems strange to me. I've been playing with Objective C a fair amount lately and the incrementing method seems completely alien to me.

I guess it's called 'retain count' but it is basically the same thing but in a weird limbo between being the lower level control offered by memory management in C (some would refer to the lack of it but I'm being nice here for reasons I don't really understand) and the more automated garbage collections found in higher level languages. Objective C uses a weird count attached to objects by release and retain messages that seems much harder to keep track of. On one hand you can send release messages to objects you no longer need to reference but that invisible integer is really what controls whether memory being deallocated or not.

All of this is dandy for the dinky little snippets of stuff that I'm writing now but I'd love to find a debugging utility that keeps track of these counts. Leaking memory makes the baby jesus cry tears made of flame and this seems like the ideal setup for those sorts of fits of crying. They are second only to the flood of tears I will produce when trying to debug the allocs in a larger batch of code. Am I just being stupid here? My acquaintance with OO oriented languages is admittedly pretty tentative but it seems like there should be an easier way of keeping track of piles of arrays than keeping track of a count manually. As always clues are much appreciated and applied liberally whenever possible.

Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.