garbage collector

Discussion in 'C++' started by Ian Upright, May 24, 2006.

  1. Ian Upright

    Ian Upright Guest

    Hi, I'm looking for a good garbage collector for C++. However, I have some
    constraints:

    In my particular application, memory fragmentation could become a real
    problem. Thereby, the garbage collector would need to have some support for
    being able to move objects around, and would preferably support generational
    and some form of copying garbage collection. This implies that the objects
    may need to be using some kind of smart pointers to manage this properly.

    Other things that are important would be:
    * delivers commercial grade high performance
    (eg, could compare to be as efficient as a Java collector, etc.)
    * extremely portable to other OS'es
    * open source

    Any ideas where I could find such a framework? I know of Managed C++ for
    Microsoft's platform, which looks ideal, but it seems Mono does not support
    this yet, and I really need cross platform portability.

    Thanks, Ian

    ---
    http://www.upright.net/ian/
    Ian Upright, May 24, 2006
    #1
    1. Advertising

  2. Ian Upright

    Ian Upright Guest

    "Luke Meyers" <> wrote:

    >Ian Upright wrote:
    >> Hi, I'm looking for a good garbage collector for C++.
    >> However, I have some constraints:

    >
    >Did none of the 472,000 hits on google for the search '"c++" "garbage
    >collector"' satisfy your constraints?


    Correct. I've spent many hours searching. Perhaps I'm an idiot. Can you
    give me any links or gc's that prove otherwise?? This is what I'm looking
    for.

    >> In my particular application, memory fragmentation could become a real
    >> problem. Thereby, the garbage collector would need to have some support for
    >> being able to move objects around, and would preferably support generational
    >> and some form of copying garbage collection.

    >
    >Memory fragmentation generally becomes a problem due to degadation of
    >speed performance, does it not? Given that this is all speculation (as
    >you evidently haven't measured anything -- have you implemented the
    >application yet?), are you sure that this degradation would be worse
    >than the overhead associated with the heavy-handed GC system you
    >envision?


    To sum up: YES. One of the primary benefits of a proper GC is that it
    gives cache locality for newly created objects. One doesn't have to dig too
    deep because there is a google full of answers to prove this if you're
    interested. An "in-place" GC such as a Boehm collector does not offer this
    and suffers from cache misses and fragmentation. This "heavy-handed" GC
    system isn't actually very heavy handed.

    >> This implies that the objects
    >> may need to be using some kind of smart pointers to manage this properly.

    >
    >Smart pointers *and* GC? Yeah? Hmm... why not smart pointers
    >*instead* of GC?


    Uhh.. Do you even know what GC is? Smart pointers are not a replacement for
    GC. One could perhaps implement reference counting or some other kind of
    mechanisim, but this has other additional overhead, and does not collect
    cycles, and is *not* modern GC. Or were you referring to some other magical
    property of smart pointers that have some magical gc mechanisim inherently
    built in. Any other intelligent comments?

    >> Other things that are important would be:
    >> * delivers commercial grade high performance
    >> (eg, could compare to be as efficient as a Java collector, etc.)
    >> * extremely portable to other OS'es
    >> * open source

    >
    >Well, once you've done your own homework and determined which GC
    >systems are available which at least claim to provide these properties,
    >I'm sure you can get some informed opinions on this newsgroup as to how
    >good they are.


    So now you're suggesting I should spend countless hours doing more research
    trying to find such GC systems (which I haven't been successful at finding),
    instead of helping point me in the right direction and pointing out some
    links that could provide what I'm looking for, when some people may already
    know it and be able to tell me.

    >> Any ideas where I could find such a framework? I know of Managed C++ for
    >> Microsoft's platform, which looks ideal, but it seems Mono does not support
    >> this yet, and I really need cross platform portability.

    >
    >Really? You want an efficient, portable, open-source solution, and
    >Managed C++ sounds ideal to you? Please tell me you're kidding. Hell,
    >hasn't even Microsoft abandoned Managed C++ in shame by now (or rather,
    >confusingly repackaged it as "C++/CLI")?


    Huh? What is "ideal" is where I'm referring to the ability to use C++ to
    finely control what objects I want manually heap managed and what objects I
    want automatically heap managed. This is the part that is ideal. Obviously
    what is not ideal is the part where this idea is not available on other
    non-MS platforms -- or is it? Prove me wrong, thanks.

    Thanks for your (lack of) help.

    Ian

    ---
    http://www.upright.net/ian/
    Ian Upright, May 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Tillie

    Garbage Collector Debugging

    Rob Tillie, Aug 15, 2003, in forum: ASP .Net
    Replies:
    11
    Views:
    1,758
    JerryK
    Aug 18, 2003
  2. Pyramis
    Replies:
    0
    Views:
    400
    Pyramis
    Jan 25, 2004
  3. Colt

    Garbage collector problem

    Colt, Nov 15, 2003, in forum: Java
    Replies:
    9
    Views:
    684
    Tim Ward
    Nov 18, 2003
  4. bart59
    Replies:
    0
    Views:
    501
    bart59
    Jun 17, 2004
  5. Will Hartung

    Garbage Collector Tuning?

    Will Hartung, Sep 8, 2004, in forum: Java
    Replies:
    3
    Views:
    2,093
    Kevin McMurtrie
    Sep 11, 2004
Loading...

Share This Page