Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why Garbage Collection is Bad

Name: Anonymous 2011-08-23 14:26

Why Garbage Collection is Bad as proven by Amdahl's Law

An excerpt from the Flow Language Manifesto

The fact that Flow eliminates the need for garbage collection and also eliminates the need for manual memory management (malloc/free or new/delete) is actually a very big deal. Just as programmers are extremely bad at writing multithreaded code and having it be maximally efficient and bug-free, so too are programmers bad at managing their own memory -- but garbage collection is only a halfbaked improvement over manual memory management, and it can turn into a crutch that programmers simply rely upon rather than understanding the nuances involved, and this can lead to serious memory leak issues.

Garbage collection was a helpful small evolutionary step in programming language design. However we need to move on to something better -- and the only truly better solution is precise implicit memory allocation and deallocation, as provided by Flow.

    Garbage collection does not solve memory leak issues. As any Java programmer knows, it is trivially easy to hold a reference to a large object that is no longer needed for an arbitrarily long period of time, but the JVM has no way of predicting if any given referenced object might conceivably be used again at some point in the future.

    In particular, if you allocate a large object in a certain scope, and then you're done using it, in Java and in a lot of other garbage-collected languages, the reference to the object is still in the local stack frame, so until that stack frame exits the garbage collector will not collect the value. This is particularly bad in data pipeline programming, where a lot of data transformations are typically implemented in the same scope, and memory hangs around a lot longer than is needed.

    In fact if you are dealing with large data objects in Java, you have to manually set all references to them to null when you are finished with them if the references aren't immediately going to go out of scope. This may as well be manual memory management, it's basically the same as an explicit free/delete. However as with manually freeing a pointer in C, where the pointer stays in scope, in Java, a reference you have set to null also stays in scope, and if you later go back and modify your code and accidentally add some code below where you set the variable to null that makes use of the variable again, you'll get a NullPointerException. With Flow, right after the last thing that could ever use an object uses it, it is automatically freed.

    Garbage collection also does not solve the need for manual memory allocation, which creates lots of boilerplate code -- e.g. when you create an ArrayList<ArrayList<String>> of specified dimensions, you need to iterate through and allocate the outer and each of the inner ArrayList objects yourself. Just adding Garbage collection to a language does not obviate the need for manual memory management.

    GC latency can be large and unpredictable -- on the order of tens of seconds per GC on a machine with tens of gigabytes of memory. Google refuses to use Java for mission-critical core infrastructure for this reason.
   
    GC generally also locks up all threads in the VM while one thread runs the garbage collector, which is becoming a bigger and bigger problem on today's multicore machines. Multithread-capable garbage collectors in the JVM are still viewed as experimental and are not on by default.

Name: Anonymous 2011-08-23 15:30

Just because the JVM is too badly designed to support a non-stop-the-world incremental garbage collector that doesn't prevent other threads from advancing doesn't mean that such a thing is impossible.

Besides, the guys at Flow are just trying to re-create Haskell.

Name: Anonymous 2011-08-23 16:41

The problem I have with proponents of GC is that they take a very militant stance against manual memory management: as if manual memory management, programming languages which feature manual memory management, and programmers who use such languages must be eradicated from the face of the Earth, as if they were some kind of disease.

Name: Anonymous 2011-08-23 17:05

The problem I have with proponents of VIP quality is that they take a very militant stance against Jews: as if Jews, programming languages made by Jews, and Jewish programmers who use such languages must be eradicated from the face of the Earth, as if they were some kind of disease.

Name: Anonymous 2011-08-23 17:06

>>3
Right, because Javatards or people who only know half of a GC'd language (Ruby, Python, Seeshup, Javascript, Lisp (though Lispers usually know better), etc.) are clearly worth of your attention. Next time I'll be saying that proponents of manual memory management (that already sounds retarded, because even in GC'd languages you should still manage some of your memory manually) are retards because on some forum in the not-worthy-of-being-indexed-by-google asshole of the internet, one idiot or two think C++ is the best thing since sliced bread.

Name: Anonymous 2011-08-23 19:47

>>5
YHBT by my delicious kopipe

Name: Anonymous 2011-08-23 20:06

NOPE.py

Name: Anonymous 2011-08-23 20:29

yes.hma

Name: Anonymous 2011-08-23 21:14

>>6
fuck you , IHBT

Name: Anonymous 2011-08-23 23:19

>>5,9
YHABT be me, for I am the original author of the kopipe

Name: Anonymous 2011-08-24 4:48

I cannot understand proponents of GC.

They cannot even handle memory on their own, yet they see themselves competenent enough to talk about GC vs manual management.

Learn to program, idiots.

Name: Anonymous 2011-08-24 5:02

>>11
I can. I just don't want to.
After switching to D from C++ I finally achieved satori.

Name: Anonymous 2011-08-24 5:32

>>11
I cannot understand opponents of GC.

They cannot even hanSegmentation fault.

Name: Anonymous 2011-08-24 5:42

>>13

Actually this is very clever for someone who cannot manage memory.

Do you want me to give some pointers?

Name: Anonymous 2011-08-24 5:51

>>14
I think he might need to free up some space in that brain of his before he's ready to comprehend what you have to say.

Name: Anonymous 2011-08-24 5:54

>>11
I use different tools for different jobs. When tight memory management is not critical, I will write code that works well with a GC assuming I know something about the GC. Much of my programming is no longer done in C or any other systems language.

Name: Anonymous 2011-08-24 6:05

i'm not even sure which i fucking hate more: lisp proponents or memory management aficionados

Name: Anonymous 2011-08-24 6:10

>>1
I like the concept of writing a Programming Language Manifesto and then doing absolutely nothing except discussing your manifesto with other autists.

It's like Lambda the Ultimate Autism or something. Mind staggers.

Name: Anonymous 2011-08-24 7:23

>>18
Agreed. He's done barely any work since posting his manifesto. It's almost like he expected the community to rise up and do all of the work for him.

Name: Anonymous 2011-08-24 7:50

>>19
Velox et Flow

Name: Anonymous 2011-08-24 8:25

>>14-15
Puns in my prog? Why wouldn't you return to proggit, gentlemen?

Name: Anonymous 2011-08-24 8:56

I like that one:
>programmer-safe
because that's just what you require: when there are only stupid code monkeys you will need a language that does most of the work for the monkey. Especially the complex work.

QUICK! Don't let the programmer program the complex parts of the program! He'll ruin the whole program!

Name: Anonymous 2011-08-24 12:06

I think he's arguing against garbage collection algorithms. Specifically Java's.

Basically he's arguing against any algorithm that scans every object, whether incrementally or not. So he'd prefer something more like reference counting.

But the Flow algorithm seems very tied in with the way their "program lattice" works.

At any rate, he's arguing about automatic memory management algorithms, not about the idea of automatic memory management.

Name: Anonymous 2011-08-24 12:08

>>22

The reason why GC is said to be for incompetent people.

Name: Anonymous 2011-08-24 12:33

You don't belong here. Quit now before all references to you disappear and you become garbage, insolent construction!

Name: Anonymous 2011-08-24 13:26


Well, I expect that requiring neither GC nor manual management will be result in pushing the complexity of dealing with memory elsewhere.

It seems that they'll have to disallow certain kinds of constructs or operations, which will lead to a situation where users will have to find walkarounds.

Prove me wrong, please. If you know of a way to achieve automagic and precise memory management without putting some weird programming constrains/paradigm on the user, I would be glad to hear about it.

Name: Anonymous 2011-08-24 13:58

>>26
The dependency graph of transformations of homogeneous sets of data not only encodes dependencies on data but implicitly encodes the life-times of the data, so the system knows precisely when the data goes in and out of scope. Coupled with things like a linear arena memory allocator on the back-end, which is extremely fast for both allocation and deallocation more so than GC heaps, it could be quite powerful.

Name: Anonymous 2011-08-24 14:52

>>26
"Walkarounds" are a small price to pay for perfect memory allocation. 50 years from now, computer scientists will be considering how programmers once had to implement "walkarounds" like malloc.

Name: Anonymous 2011-08-24 15:21

Phone me back when the Flow team has a bootstrapping compiler (without a GC, and without using any external program that features a GC).

Name: Anonymous 2011-08-24 16:36

The title is right. GC is shit.

Name: Anonymous 2011-08-24 16:36

If it ain't GC, it's shit.

Name: Anonymous 2011-08-24 16:46

It it ain't shit, it ain't GC.

Name: Anonymous 2011-08-24 16:57

>>32
Wrong bitch. Now bend over, faggot.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List