• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GC pros and cons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC pros and cons


  • Subject: Re: GC pros and cons
  • From: Klaus Backert <email@hidden>
  • Date: Sat, 27 Jun 2009 15:30:15 +0200


On 27. Jun 2009, at 14:17, Thomas Davie wrote:

Now I'm confused, because other people said, GC frees objects *when* nothing depends on them any more *or* at some point later in time. By the way, it would be different, if you said "if" instead of "when", but then, I think, you would have no point in the ongoing discussion.

Why is this a problem?

It's not a problem for me (and I didn't say so).

Nothing depends on the objects, and hence nothing can see when they're actually collected. If you're worried about running out of space because the collector is lazy

I'm not worried about this.

, then all you need to know is that as soon as you get to the "oh shit, no memory" stage, the collector runs and frees some more up (unless there really is none to free up).

All you're doing by keeping track of the dependancy graph yourself is reinventing the wheel

I'm not reinventing the wheel, I use simple retain/release based memory management -- and after all these years it *is* simple for me.


-- lots of people have put a lot of research into how to keep track of those dependancies fast, and in a way that frees up memory quickly and efficiently.

Is it correct reading your answer as "wether objects are freed *when* nothing depends on them any more *or* at some point later in time -- it does *not* matter"?


Still open question:
With GC are objects freed *when* they are used any more *or* at some point later in time?


And if it doesn't matter, doesn't it really matter in *all* cases?

By the way, I won't start using GC now because I'm in the midst of a project I started without GC. A "monster" :-) dependency graph inside is built using OpenSceneGraph, which has its own memory management mechanism.

Klaus

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: GC pros and cons (From: James Gregurich <email@hidden>)
 >Re: GC pros and cons (From: Thomas Davie <email@hidden>)
 >Re: GC pros and cons (From: Thomas Davie <email@hidden>)

  • Prev by Date: Re: NSUrl: Which method to use
  • Next by Date: Re: GC pros and cons
  • Previous by thread: Re: GC pros and cons
  • Next by thread: Re: GC pros and cons
  • Index(es):
    • Date
    • Thread