skip to main content
research-article

Dynamic space limits for Haskell

Published:09 June 2014Publication History
Skip Abstract Section

Abstract

We describe the semantics and implementation of a space limits system for Haskell, which allows programmers to create resource containers that enforce bounded resident memory usage at runtime. Our system is distinguished by a clear allocator-pays semantics drawn from previous experience with profiling in Haskell and an implementation strategy which uses a block-structured heap to organize containers, allowing us to enforce limits with high accuracy. To deal with the problem of deallocating data in a garbage collected heap, we propose a novel taint-based mechanism that unifies the existing practices of revocable pointers and killing threads in order to reclaim memory. Our system is implemented in GHC, a production-strength compiler for Haskell.

References

  1. G. Back and W. C. Hsieh. The KaffeOS Java runtime system. ACM Trans. Program. Lang. Syst., 27(4):583--630, July 2005. ISSN 0164-0925.. URL http://doi.acm.org/10.1145/1075382.1075383. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. Banga, P. Druschel, and J. C. Mogul. Resource containers: a new facility for resource management in server systems. In Proceedings of the third symposium on Operating systems design and implementation, OSDI '99, pages 45--58, Berkeley, CA, USA, 1999. USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Czajkowski and T. von Eicken. JRes: a resource accounting interface for Java. In Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, OOPSLA '98, pages 21--35, New York, NY, USA, 1998. ACM. ISBN 1-58113-005-8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. G. DeCandia, D. Hastorun, M. Jampani, G. Kakulapati, A. Lakshman, A. Pilchin, S. Sivasubramanian, P. Vosshall, and W. Vogels. Dynamo: Amazon's highly available key-value store. In Proceedings of Twenty-first ACM SIGOPS Symposium on Operating Systems Principles, pages 205--220, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. K. Dybvig, D. Eby, and C. Bruggeman. Don't stop the BIBOP: Flexible and efficient storage management for dynamically-typed languages. Technical report, 1994.Google ScholarGoogle Scholar
  6. M. Fluet and G. Morrisett. Monadic regions. 16(4--5):485--545, July 2006. ISSN 0956-7968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Gaboardi and R. Péchoux. Upper bounds on stream I/O using semantic interpretations. In Proceedings of the 23rd CSL international conference and 18th EACSL Annual conference on Computer science logic, CSL'09/EACSL'09, pages 271--286, Berlin, Heidelberg, 2009. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. D. B. Giffin, A. Levy, D. Stefan, D. Terei, D. Mazières, J. Mitchell, and A. Russo. Hails: Protecting data privacy in untrusted web applications. In 10th Symposium on Operating Systems Design and Implementation (OSDI), pages 47--60. USENIX, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. N. Hallenberg, M. Elsman, and M. Tofte. Combining region inference and garbage collection. In Proceedings of the ACM SIGPLAN 2002 conference on Programming language design and implementation, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Hawblitzel and T. von Eicken. Luna: a flexible Java protection system. SIGOPS Oper. Syst. Rev., 36(SI):391--403, Dec. 2002. ISSN 0163--5980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Hicks, P. Kakkar, J. T. Moore, C. A. Gunter, and S. Nettles. Plan: a packet language for active networks. SIGPLAN Not., 34(1):86--93, Sept. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. L. P. Jones. Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine. Journal of Functional Programming, 2:127--202, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  13. S. Marlow, S. P. Jones, A. Moran, and J. Reppy. Asynchronous exceptions in Haskell. In Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Marlow, T. Harris, R. P. James, and S. Peyton Jones. Parallel generational-copying garbage collection with a block-structured heap. In Proceedings of the 7th international symposium on Memory management, ISMM '08, pages 11--20, New York, NY, USA, 2008. ACM. ISBN 978-1-60558-134-7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. G. C. Necula. Proof-carrying code. In Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '97, pages 106--119, New York, NY, USA, 1997. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. W. Partain. The nofib benchmark suite of Haskell programs. Proceedings of the 1992 Glasgow Workshop on Functional Programming, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. W. Price, A. Rudys, and D. S. Wallach. Garbage collector memory accounting in language-based systems. In Proceedings of the 2003 IEEE Symposium on Security and Privacy, SP '03, Washington, DC, USA, 2003. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Reid. Putting the spine back in the Spineless Tagless G-Machine: An implementation of resumable black-holes. In In Proc. IFL'98 (selected papers), volume 1595 of LNCS, pages 186--199. Springer-Verlag, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. M. Sansom and S. L. Peyton Jones. Time and space profiling for non-strict, higher-order functional languages. In Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '95, pages 355--366, New York, NY, USA, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. S. Shapiro, J. M. Smith, and D. J. Farber. EROS: a fast capability system. In In Symposium on Operating Systems Principles, pages 170--185, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. G. Steele. Data representations in PDP-10 MACLISP. Technical report, MIT, 1977.Google ScholarGoogle Scholar
  22. D. Stefan, A. Russo, D. Mazières, and J. C. Mitchell. Disjunction category labels. In 16th Nordic Conference on Security IT Systems, NordSec, volume 7161 of LNCS, pages 223--239. Springer, October 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Stefan, A. Russo, J. C. Mitchell, and D. Mazières. Flexible dynamic information flow control in Haskell. In Proc. of the 4th Symposium on Haskell, pages 95--106, September 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Terei, S. Marlow, S. Peyton Jones, and D. Mazières. Safe Haskell. SIGPLAN Not., 47(12):137--148, Sept. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. G. Wagner, A. Gal, C. Wimmer, B. Eich, and M. Franz. Compartmental memory management in a modern web browser. In Proceedings of the International Symposium on Memory Management, ISMM '11, pages 119--128, New York, NY, USA, 2011. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. A. Wick and M. Flatt. Memory accounting without partitions. In Proceedings of the 4th international symposium on Memory management, ISMM '04, pages 120--130, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. N. Zeldovich, S. Boyd-Wickizer, E. Kohler, and D. Mazières. Making information flow explicit in HiStar. In Proc. of the 7th Symp. on Operating Systems Design and Implementation, pages 263--278, Seattle, WA, November 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic space limits for Haskell

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 49, Issue 6
      PLDI '14
      June 2014
      598 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2666356
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation
        June 2014
        619 pages
        ISBN:9781450327848
        DOI:10.1145/2594291

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 9 June 2014

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!