skip to main content
10.1145/1411304.1411308acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Hashconsing in an incrementally garbage-collected system: a story of weak pointers and hashconsing in ocaml 3.10.2

Published: 21 September 2008 Publication History

Abstract

This article describes the implementations of weak pointers, weak hashtables and hashconsing in version 3.10.2 of the Objective Caml system, with focus on several performance pitfalls and their solutions.

References

[1]
Andrew W. Appel and Marcelo J. R. Gonçalves. Hash-consing garbage collection. Technical Report CS-TR-412-93, Computer Science Department, 1993. URL citeseer.ist.psu.edu/111544.html.
[2]
Andrew W. Appel and David B. MacQueen. Standard ML of New Jersey. In J. Maluszyński and M. Wirsing, editors, Proceedings of the Third International Symposium on Programming Language Implementation and Logic Programming, number 528, pages 1--13. Springer Verlag, 1991. URL citeseer.ist.psu.edu/appel91standard.html.
[3]
Henry G. Baker. List processing in rea-ltime on a serial computer. Communications of the ACM, 21 (4): 280--94, 1978. URL http://citeseer.ist.psu.edu/baker78list.html.
[4]
David Beazley and Guido Van Rossum. Python; Essential Reference. New Riders Publishing, Thousand Oaks, CA, USA, 1999. ISBN 0735709017.
[5]
Richard Bonichon, David Delahaye, and Damien Doligez. Zenon : An extensible automated theorem prover producing checkable proofs. In Nachum Dershowitz and Andrei Voronkov, editors, LPAR, volume 4790 of Lecture Notes in Computer Science, pages 151--165. Springer, 2007. ISBN 9783540755586.
[6]
Emmanuel Chailloux, Pascal Manoury, and Bruno Pagano. Développement d'applications avec Objective Caml. O'Reilly, 2000.
[7]
Edmund M. Clarke, Orna Grumberg, and Doron A. Peled. Model Checking. The MIT Press, 1999.
[8]
Sylvain Conchon and Evelyne Contejean. The Alt-Ergo automatic theorem prover, 2006. URL http://altergo.lri.fr/.
[9]
Jeffrey Considine. Efficient hash-consing of recursive types, 2000. URL http://citeseer.ist.psu.edu/article/rey00ecient.html.
[10]
P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 238--252, Los Angeles, California, 1977. ACM Press, New York, NY.
[11]
Conal Elliott and Paul Hudak. Functional reactive animation. In International Conference on Functional Programming, 1997. URL http://conal.net/papers/icfp97/.
[12]
Jean-Christophe Filliâtre and Sylvain Conchon. Type-safe modular hash-consing. In ML '06: Proceedings of the 2006 workshop on ML, pages 12--19, New York, NY, USA, 2006. ACM. ISBN 1-59593-483-9. URL http://doi.acm.org/10.1145/1159876.1159880.
[13]
Frama-C development team. Frama-C: Framework for modular analysis of C, 2008. URL http://frama-c.cea.fr/.
[14]
James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. Java Language Specification, Second Edition: The Java Series. Addison Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2000. ISBN 0201310082.
[15]
Eiichi Goto. Monocopy and associative algorithms in an extended lisp. Technical Report TR 74-03, University of Tokyo, 1974.
[16]
Bruno Haible. Weak References, Data Types and Implementation, 2005. URL http://www.haible.de/bruno/papers/cs/weak/WeakDatastructures-writeup.html.
[17]
Xavier Leroy. The Objective Caml system, release 1.07, Documentation and user's manual, 1997. URL http://caml.inria.fr/pub/distrib/ocaml-1.07/ocaml-1.07-refman.txt.
[18]
Xavier Leroy, Damien Doligez, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. The Objective Caml system, release 3.10, Documentation and user's manual, 2007. URL http://caml.inria.fr/pub/distrib/ocaml-3.10/ocaml-3.10-refman.txt.
[19]
Zheng Li. Weaktbl, a weak hash table library for OCaml, 2007. http://www.pps.jussieu.fr/~li/software/weaktbl/README.
[20]
Laurent Mauborgne. Improving the representation of infinite trees to deal with sets of trees. In G. Smolka, editor, European Symposium on Programming (ESOP 2000), volume 1782 of Lecture Notes in Computer Science, pages 275--289. Springer-Verlag, 2000.
[21]
Benjamin Monate and Julien Signoles. Slicing for security of code. In Trust 2008, Lecture Notes in Computer Science. Springer-Verlag, 2008.
[22]
Chris Okasaki and Andrew Gill. Fast mergeable integer maps. In Workshop on ML, pages 77--86, 1998. URL http://citeseer.ist.psu.edu/okasaki98fast.html.
[23]
Simon L. Peyton-Jones, Simon Marlow, and Conal Elliott. Stretching the storage manager: Weak pointers and stable names in haskell. In Implementation of Functional Languages, pages 37--58, 1999. URL http://citeseer.ist.psu.edu/peytonjones99stretching.html.
[24]
François Pottier and Yann Régis-Gianas. Menhir, December 2005. URL http://cristal.inria.fr/~fpottier/menhir/.
[25]
Zhong Shao. An overview of the FLINT/ML compiler. In Proc. 1997 ACM SIGPLAN Workshop on Types in Compilation (TIC'97), Amsterdam, The Netherlands, June 1997.
[26]
Wikipedia. File Allocation Table, 2008. URL http://en.wikipedia.org/wiki/File_Allocation_Table.
[27]
Paul R. Wilson. Uniprocessor garbage collection techniques. In Proc. Int. Workshop on Memory Management, number 637 in LNCS, Saint-Malo (France), 1992. Springer-Verlag. URL http://citeseer.ist.psu.edu/wilson92uniprocessor.html.

Cited By

View all

Index Terms

  1. Hashconsing in an incrementally garbage-collected system: a story of weak pointers and hashconsing in ocaml 3.10.2

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ML '08: Proceedings of the 2008 ACM SIGPLAN workshop on ML
    September 2008
    106 pages
    ISBN:9781605580623
    DOI:10.1145/1411304
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 21 September 2008

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. garbage collection
    2. hash-consing
    3. maximal sharing
    4. ocaml
    5. weak hashtables
    6. weak pointers
    7. weak references

    Qualifiers

    • Research-article

    Conference

    ICFP08
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 6 of 11 submissions, 55%

    Upcoming Conference

    ICFP '25
    ACM SIGPLAN International Conference on Functional Programming
    October 12 - 18, 2025
    Singapore , Singapore

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)1
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 08 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)The Art of Developing Frama-C Plug-insGuide to Software Verification with Frama-C10.1007/978-3-031-55608-1_7(341-401)Online publication date: 10-Jul-2024
    • (2015)Frama-C: A software analysis perspectiveFormal Aspects of Computing10.1007/s00165-014-0326-727:3(573-609)Online publication date: 9-Jan-2015
    • (2009)Experience reportACM SIGPLAN Notices10.1145/1631687.159659144:9(281-286)Online publication date: 31-Aug-2009
    • (2009)Experience reportProceedings of the 14th ACM SIGPLAN international conference on Functional programming10.1145/1596550.1596591(281-286)Online publication date: 31-Aug-2009

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media