Jump to content

Talk:Garbage collection (computer science): Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
MiszaBot I (talk | contribs)
m Robot: Archiving 1 thread (older than 60d) to Talk:Garbage collection (computer science)/Archive 2.
Line 34: Line 34:


I reworded "The garbage collector can reclaim only objects that have no references.", because it is potentially confusing. Let X be an object and let Y be an object. Suppose that X references Y. Y can be garbage, if X is also garbage. Therefore, Y can be garbage, even though it has references that point to it. A trivial example of this scenario is cyclic references among garbage objects. <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:M17|M17]] ([[User talk:M17|talk]] • [[Special:Contributions/M17|contribs]]) 04:46, 25 October 2012 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
I reworded "The garbage collector can reclaim only objects that have no references.", because it is potentially confusing. Let X be an object and let Y be an object. Suppose that X references Y. Y can be garbage, if X is also garbage. Therefore, Y can be garbage, even though it has references that point to it. A trivial example of this scenario is cyclic references among garbage objects. <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:M17|M17]] ([[User talk:M17|talk]] • [[Special:Contributions/M17|contribs]]) 04:46, 25 October 2012 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->

== Minsky-Feinchel-Yochelson Garbage Collector Algorithm ==

Should this be mentioned? I heard about it on [ttp://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures Lesson 10B of MIT's programming series from the 80s]. Apparently at that time it was the fastest garbage collector algorithm, according to the lecturer. [[Special:Contributions/209.66.74.34|209.66.74.34]] ([[User talk:209.66.74.34|talk]]) 03:08, 11 December 2012 (UTC)

Revision as of 03:08, 11 December 2012

"semantic" versus "syntactic" garbage: poor terminology

The article uses the term syntactic garbage in reference to objects which are actually not reachable through the transitive closure of live references. This is a poor term, because this reachability very much has to do with the semantics of what computation has occured until now. Only in trivial examples is this linked to the syntactic structure of the program. If garbage was syntactic, it could be statically analyzed without the need for a tracing garbage collector! Note that any language which is compiled and designed for garbage collection from the ground up, the compiler can help the garbage collector. If a variable has no next use in a block of code (as determined by the compiler's data flow analysis), then that variable need not be considered as a source of live references for GC. The compiler can emit information so that no matter what execution point in the code triggers GC, the information about variable liveness in that scope is accurate. So it is not true what the article claims: that an object can become syntactic garbage long before it goes out of scope. That is precisely what liveness analysis is for. This is a problem of a poorly integrated garbage collector (e.g. a bolt-on GC library for C programs which blindly scans the stack.)192.139.122.42 (talk) 23:43, 2 November 2011 (UTC) 123 — Preceding unsigned comment added by 121.245.56.14 (talk) 06:53, 22 March 2012 (UTC)[reply]

Disadvantage: You can't have pointers, only references.

What exactly does this mean? Isn't the reference vs. pointer distinction a C++ism? Java certainly allows Null..uh, references, for instance, and things like the Boehm GC for C exists. Surely C has pointers? Ketil (talk) 13:59, 17 January 2012 (UTC)[reply]

Also, although it's not clear from the article, I'm fairly sure a modern GC doesn't have to touch the garbage, i.e. that it's running time will be proportional to the live heap only. This is a potential performance advantage over manual memory management, which requires the user to free every allocated object. Ketil (talk) 14:07, 17 January 2012 (UTC)[reply]

Dead Link

Link "OpenRTL - Contains a mark and sweep collector for a standard dynamic allocation heap, with precise scanning support." seems to be dead. — Preceding unsigned comment added by 194.25.238.250 (talk) 13:35, 25 July 2012 (UTC)[reply]

Reworded a Potentially Confusing Sentence

I reworded "The garbage collector can reclaim only objects that have no references.", because it is potentially confusing. Let X be an object and let Y be an object. Suppose that X references Y. Y can be garbage, if X is also garbage. Therefore, Y can be garbage, even though it has references that point to it. A trivial example of this scenario is cyclic references among garbage objects. — Preceding unsigned comment added by M17 (talkcontribs) 04:46, 25 October 2012 (UTC)[reply]

Minsky-Feinchel-Yochelson Garbage Collector Algorithm

Should this be mentioned? I heard about it on [ttp://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures Lesson 10B of MIT's programming series from the 80s]. Apparently at that time it was the fastest garbage collector algorithm, according to the lecturer. 209.66.74.34 (talk) 03:08, 11 December 2012 (UTC)[reply]