garbage collector

I

Ian Upright

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
 
I

Ian Upright

Luke Meyers said:
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.
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.
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?
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.
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top