5 ms·
You can't just redefine a word that a person has already defined (albeit implicitly), in order to make them wrong. That's not how being right on the internet wo
by srssays 10y ago
You can't just redefine a word that a person has already defined (albeit implicitly), in order to make them wrong. That's not how being right on the internet works. If you want to be right on the internet, you have to define the word before they do.
- toomim 10y agoHe's not redefining it. It was defined in the 70s. https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Reference_counting https://en.wikipedia.org/wiki/Garbage_collection_(computer_s... Reference counting is definitely a method of garbage collection.
- Ace17 10y agoThis is just terminology. The important question here is: "Can your program leak memory?"
- hellofunk 10y agoThe risk of memory problems don't disappear because of any form of GC. The problems are just different, and leaks are still quite possible.
- gozur88 10y agoThey're possible, but not nearly as common. Back when I was coding C++ full time I spent most of my debugging time chasing down memory leaks and out-of-scope variables. Then in a decade of Java programming I think I had one memory leak.
- hellofunk 10y agoBut that's a two-edged sword. Many Java developers, especially those recently out of school, who have never had a C or C++ background, think the GC is a magical blanket that takes care of everything, and as a consequence they don't have an intuitive grasp of the true costs of memory. They just throw things around like it's no big deal. I've interacted with a lot of C++ developers who were hired to rewrite large Java applications in C++ for performance reasons, when really Java could have handled it if only the developers understood memory better. GC is an abstraction that can work well but can also interfere with how a developer thinks.
- pjmlp 10y ago> I've interacted with a lot of C++ developers who were hired to rewrite large Java applications in C++ for performance reasons, when really Java could have handled it if only the developers understood memory better. Yep, this is a big issue. Another good example is copying arrays of primitive types with for loops instead of using intrisics like System.arrayCopy(). Or using lists instead of arrays. Sure there are many situations where there is no another way other than step out of the JVM into C++, but many could be avoided with better code as well.
- ygra 10y agoI think Raymond Chen once noted that garbage collection just aims to give the programmer the illusion of infinite memory under the assumption that only finite amounts of memory are every in use at once, while also absolving them from having to release memory manually. So if your program allocated less than available, doing nothing would be a valid GC strategy as your program never hit an upper bound in what it can allocate. I found that an interesting way to think about the problem because it's more concerned with what GC enables instead of what it strictly does. The former is always the same, no matter the GC implementation, but the latter can vary considerably (doing nothing, reference counting, mark-and-sweep, full concurrent and compacting GC, ...).
- toomim 10y ago> garbage collection just aims to give the programmer the illusion of infinite memory under the assumption that only finite amounts of memory are every in use at once, while also absolving them from having to release memory manually. Interestingly, this is also the description of Virtual Memory. https://en.wikipedia.org/wiki/Virtual_memory https://en.wikipedia.org/wiki/Virtual_memory
- pjmlp 10y agoI have not redefined anything. http://gchandbook.org/ http://gchandbook.org/ Chapter 5. One of the best CS references in GC algorithms. I can post links to 70's papers if you wish, specially ones related to Lisp research.
- deleted 10y ago[deleted]