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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- M. Fluet and G. Morrisett. Monadic regions. 16(4--5):485--545, July 2006. ISSN 0956-7968. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- W. Partain. The nofib benchmark suite of Haskell programs. Proceedings of the 1992 Glasgow Workshop on Functional Programming, 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- G. Steele. Data representations in PDP-10 MACLISP. Technical report, MIT, 1977.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Terei, S. Marlow, S. Peyton Jones, and D. Mazières. Safe Haskell. SIGPLAN Not., 47(12):137--148, Sept. 2012. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Dynamic space limits for Haskell
Recommendations
Dynamic space limits for Haskell
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe 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 ...
The Intel labs Haskell research compiler
Haskell '13The Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult ...
The Intel labs Haskell research compiler
Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on HaskellThe Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult ...







Comments