Jump to content

Talk:Garbage collection (computer science)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

List of Garbage Collection features, by Language

So I was hunting around the internet looking for an exhaustive list of programming languages and a description of their Garbage Collection scheme, and perhaps a list showing which languages do and do not have GC.

Being acclimated to the instantaneous gratification that the internet often brings, I expected that I would, in a few minutes be staring at one of those fancy colored tables on a wikipedia article.

Alas, after an hour my search never bore fruit. This table does not exist!

I can't even find it on websites, let alone wikipedia. Now several hours into this research, I have come away with a little more knowledge than I had before. This new knowledge has convinced me that such a colored table is needed more than ever before. I may end up being the author myself.

It would be unfortunate for someone to work through the first six chapters of a book on R, only to find out in chapter 7 (surprise mothef___r) , R has GC, but it is not automatic, and has to be implemented by linking a third-party library and calling bizarre library functions in this complicated way ( as detailed by this blog in the dark recesses of the internet. )

Compile-time quasi-GC

Then there is this issue with the language Rust. Rust has no GC in the manner of say, Java, where it runs as a separate thread doing magic behind the scenes. Rust therefore allows pointers, call-by-reference, and allocation and free-ing a la C. However, the compiler does some manner of sorcery that checks for plausible memory leaks and dangling pointers right at compile time. If a table existed, the entry on Rust would say red "NO" to "has GC". In the column for "compile-time pointer checks" it would say "YES", in green.

Stop The World

JVM languages (Clojure, Scala, et al) have a GC which will halt all threads while the GC comes in and sweeps the RAM clean -- a task often referred to as a "Stop-the-World" event. STWs happen erratically and the application programmer has no control over when , if, or how long the stop takes to complete before handing control back to the program threads. While most of us could care less, this would be a deal-breaker for a realtime game. (imagine a stubborn STW event kicks in, in the middle of a cutscene. The player would think he has crashed, and would reach for the reset button on his Playstation 4. ) Anyways, on our theoretical table, there would be a column labelled "GC has Stop-the-World events" and there would be a green "YES" on Java's entry.

Sweep and Reference Counting

Some GCs utilized Mark-and-sweep, while other GCs use "Reference counting", or perhaps "Tracing without MandS". There may even exist languages that use a strange mixture of these (Python?). Our theoretical table should contain a column for these kinds, with YES's and NO's in appropriate places.

In the meanwhile, here is the existing wikipedia article on Garbage Collection. There is no table there, and no link to any other article with such a useful table.

It is time to write one. Let's do this. 7 December 2018 Miloserdia (talk) 23:33, 7 December 2018 (UTC)[reply]

syntactical vs. semantical garbage

In Reachability of an object both terms (syntactical and semantical garbage) are used, which might be confusing the reader. If both mean the same, the alternative term could be introduced.

split

This article has a garbage collection (computer science)#Real-time section. I see that another article has a section on real-time garbage collection ( tracing garbage collection#Real-time garbage collection ). Would it be better to create a stand-alone "real-time garbage collection" article to discuss such algorithms, and convert both of those sections to short WP:SUMMARY of that article? --DavidCary (talk) 17:38, 8 December 2015 (UTC)[reply]

Move vailable location

Can you add "The grabage collector move the memory locations of variables, so it causes limitations using pointers, which cause inconvenience for programming." into the Disadventage section? --60.251.198.234 (talk) 02:01, 24 May 2016 (UTC)[reply]