Title
Eliminating Cycles in Weak Tables
Abstract
Weak References constitute an elegant mechanism for an application to interact with its garbage collector. In most of its typical uses, weak references are used through weak tables (e. g., Java's WeakHashMap). However, most implementations of weak tables have a severe limitation: Cyclic references between keys and values in weak tables prevent the elements inside a cycle from being collected, even if they are no longer reachable from outside. This ends up bringing difficulties to the use of weak tables in some kinds of applications. In this work, we present our approach for overcoming this problem in the context of the Lua programming language. Our approach consists of an adaptation of the ephemerons mechanism to tables. We modified the garbage collector of the Lua virtual machine in order to offer support to this mechanism. With this adapted garbage collector we could verify the efficiency and effectiveness of the implementation in solving the problem of cycles on weak tables in Lua.
Year
Venue
Keywords
2008
JOURNAL OF UNIVERSAL COMPUTER SCIENCE
Garbage collection,weak tables,weak references
Field
DocType
Volume
Weak reference,Virtual machine,Programming language,Computer science,Implementation,Garbage collection,Ephemeron,Garbage in, garbage out,Java
Journal
14
Issue
ISSN
Citations 
21
0948-695X
1
PageRank 
References 
Authors
0.40
10
2
Name
Order
Citations
PageRank
Alexandra Barros110.40
Roberto Ierusalimschy246354.25