Effective “static-graph” reorganization to improve locality in garbage-collected systems

Several researchers have attempted to improve locality in garbage-collected heaps by changing the traversal algorithm used by a copying garbage collector. Unfortunately, these studies met with small success. We hypothesized that the disappointing results of these previous studies were due to two flaws in the traversal algorithms tested. They failed to group data structures in a manner reflecting their hierarchical organization, and more importantly, they ignored the dkastrous grouping effects caused by reaching data structures from a linear traversal of hash tables (i.e., in pseudo-random order). To test this hypothesis, we modified the garbage collector of a Lisp system (specifically, the Scheme-48 system) to avoid both problems in reorganizing the system heap image. We implemented our “hierarchical decomposition” algorithm (a cousin of Moon’s “approximately depth-fiist” algorithm) that is quite efficient on stock hardware. We aleo changed the collector to traverse global variable bindings in the order of their creation rather than in the memory order imposed by hash tables. The effects of these changes confirm our hypothesis. Some improvement comes from the basic traversal algorithm, and a greater effect results from the special treatment of hash tables. Initial page faults are reduced significantly and repeated page faults are reduced tremendously (by roughly an order of magnitude). In addition, improved measures of static locality (such as the percentage of on-page pointers) indicate that heap data can be cheaply and effectively compressed, and this may allow more effective paging and prefetching strategies; we suggest a level of “compressed in-RAM storage”, with price and performance between those of RAM and disk. These results call for a reinterpretation of previous studies, and for further studies of static-graph traversal techniques. They reduce the attractiveness of the exotic hardware needed for dynamically reorganizing objects within pages, and show that good locality can easily be achieved by straightforward and efficient techniques on stock hardware. Permission to copy without fee all or part of this material is granted provided that the copies ere not mede or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission. @ 1991 ACM 0-89791-428-7/91/0005/01 77...$1.50 Proceedings of the ACM SIGPLAN ‘91 Conference on Programming Language Design and Implementation. Toronto, Ontario, Canada, June 26-28, 1991.

[1]  Randy H. Katz,et al.  Exploiting inheritance and structure semantics for effective clustering and buffering in an object-oriented DBMS , 1989, SIGMOD '89.

[2]  David Ungar Generation scavenging: a nondisruptive high performance storage reclamation algorithm , 1984 .

[3]  Douglas W. Clark,et al.  An empirical study of list structure in Lisp , 1977, CACM.

[4]  Ricki Blau Paging on an object-oriented personal computer , 1983, SIGMETRICS '83.

[5]  Tom Moher,et al.  Design of the opportunistic garbage collector , 1989, OOPSLA 1989.

[6]  Alan Jay Smith,et al.  Sequential Program Prefetching in Memory Hierarchies , 1978, Computer.

[7]  Patrick Sobalvarro,et al.  A Lifetime-based Garbage Collector for LISP Systems on General- Purpose Computers , 1988 .

[8]  Henry Lieberman,et al.  A real-time garbage collector based on the lifetimes of objects , 1983, CACM.

[9]  Jean-Loup Baer,et al.  Dynamic Improvement of Locality in Virtual Memory Systems , 1976, IEEE Transactions on Software Engineering.

[10]  Trevor Hopkins,et al.  Dynamic Grouping in an Object-Oriented Virtual Memory Hierarchy , 1987, ECOOP.

[11]  Benjamin G. Zorn,et al.  Comparing mark-and sweep and stop-and-copy garbage collection , 1990, LISP and Functional Programming.

[12]  Andrew W. Appel,et al.  Garbage Collection can be Faster than Stack Allocation , 1987, Inf. Process. Lett..

[13]  Chih-Jui Peng,et al.  Cache Memory Design Considerations to Support Languages with Dynamic Heap Allocation , 1989 .

[14]  Peter Lee,et al.  Cache performance of combinator graph reduction , 1990, Proceedings. 1990 International Conference on Computer Languages.

[15]  J. White,et al.  Address/memory management for a gigantic LISP environment or, GC considered harmful , 1987, LIPO.

[16]  Benjamin G. Zorn,et al.  Comparative performance evaluation of garbage collection algorithms , 1989 .

[17]  Chris J. Cheney A nonrecursive list compacting algorithm , 1970, Commun. ACM.

[18]  Robert Allen Shaw,et al.  Empirical analysis of a LISP system , 1988 .

[19]  Domenico Ferrari,et al.  Improving locality by critical working sets , 1974, CACM.

[20]  James W. Stamos,et al.  Static grouping of small objects to enhance performance of a paged virtual memory , 1984, TOCS.

[21]  David A. Moon,et al.  Garbage collection in a large LISP system , 1984, LFP '84.

[22]  Paul R. Wilson,et al.  Pointer swizzling at page fault time: efficiently supporting huge address spaces on standard hardware , 1991, CARN.

[23]  R. Nigel Horspool,et al.  Analysis and development of demand prepaging policies , 1987, J. Syst. Softw..

[24]  S. L. Graham,et al.  List Processing in Real Time on a Serial Computer , 1978 .

[25]  Andrew W. Appel,et al.  Virtual memory primitives for user programs , 1991, ASPLOS IV.

[26]  Paul R. Wilson,et al.  Some issues and strategies in heap management and memory hierarchies , 1991, SIGP.

[27]  Jon L. White,et al.  Address/Memory Management for a Gigantic LISP Environment. , 1980 .

[28]  Douglas Johnson The case for a read barrier , 1991, ASPLOS IV.

[29]  David M. Ungar,et al.  Generation Scavenging: A non-disruptive high performance storage reclamation algorithm , 1984, SDE 1.

[30]  Robert Courts,et al.  Improving locality of reference in a garbage-collecting memory management system , 1988, CACM.

[31]  J. T. Robinson,et al.  Data cache management using frequency-based replacement , 1990, SIGMETRICS '90.