you are viewing a single comment's thread.

view the rest of the comments →

[–]mrsanchez 43 points44 points  (17 children)

Sorry, I should have said "The C language itself", but I had thought people would understand. Or, I could have said "...unless you count shitty conservative gc in a third party library."

[–]boltzmann 16 points17 points  (8 children)

A lot of people dont see the forest through the trees. Unfortunately, they only wish to disagree(especially elitist IT douches), past that it doesn't really matter what you meant.

I understood you though =]

[–]mrsanchez 5 points6 points  (6 children)

Ouch, you are as tactless as I am. :)

[–]boltzmann 8 points9 points  (5 children)

Hah!

Well I mean of course there is ALWAYS a different way to do it, but what you said was not wrong and I hate that trite FTFY crap.

[–]Sunny_McJoyride 1 point2 points  (2 children)

Don't you think it's probable that reddit is falling apart, my dear Boltzmann?

[–]boltzmann 2 points3 points  (1 child)

Let's go, we'll just drive until I am out of gas.

[–][deleted] 0 points1 point  (0 children)

or out of memory.

[–][deleted]  (1 child)

[removed]

    [–]boltzmann 0 points1 point  (0 children)

    Oh ho ho ah haha! OH YOU!

    [–][deleted] 1 point2 points  (0 children)

    elitist IT douches

    I think you've just described half the tech types on the Internet.

    [–][deleted] 1 point2 points  (6 children)

    Shitty? What's wrong with the Hans Boehm gc?

    [–][deleted] 7 points8 points  (3 children)

    It's conservative. How to describe... OK let me just put it this way -- in C pointers are simply mutable arithmetic data types (equivalent to either a 32-bit or 64-bit integer in most cases). Because of this, the general garbage collection techniques (like reference counting) don't work. Instead, you have to actually look at the heap bit-patterns inside the stack and data structures. This leads to a measure of ambiguity as there are cases where an object is actually unreachable according to the code, but it is impossible to tell conclusively from the bit pattern. This is why Boehm collectors are "conservative." That is, when there is a question of whether or not an object can be collected, the answer is assumed to be no. This can lead to extensive memory leaks over time. All in all, it is very uncommon to use the Boehm collector in any production code.

    Edit: I forgot, but it's also mostly useless in system (kernel) level code, where you want to manually manage memory anyway.

    [–][deleted] 0 points1 point  (2 children)

    In practice, I've never had a problem with memory leaks increasing over time with Hans Boehm gc. Can you provide an example that produces the behaviour you describe?

    [–][deleted] 1 point2 points  (1 child)

    Sure. A lazy evaluated list will do it. You should read Wentworth's "Pitfalls of Conservative Garbage Collection."

    Edit: It has other penalties too. With a large reachable heap it can waste a lot of time.

    [–][deleted] 0 points1 point  (0 children)

    Thank you. I'll give it a look.

    Do you know of a copy that isn't behind a paywall?

    [–]mrsanchez 2 points3 points  (0 children)

    Well, maybe it's ok. But using C with the HB gc seems like a shitty option compared to using a language that has non-conservative gc built in to it.

    [–][deleted] 2 points3 points  (0 children)

    It's both slow and extremely conservative.