Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1029873.1029883acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
Article

Experience with safe manual memory-management in cyclone

Published: 24 October 2004 Publication History

Abstract

The goal of the Cyclone project is to investigate type safety for low-level languages such as C. Our most difficult challenge has been providing programmers control over memory management while retaining type safety. This paper reports on our experience trying to integrate and effectively use two previously proposed, type-safe memory management mechanisms: statically-scoped regions and unique pointers. We found that these typing mechanisms can be combined to build alternative memory-management abstractions, such as reference counted objects and arenas with dynamic lifetimes, and thus provide a flexible basis. Our experience---porting C programs and building new applications for resource-constrained systems---confirms that experts can use these features to improve memory footprint and sometimes to improve throughput when used instead of, or in combination with, conservative garbage collection.

References

[1]
Peter Achten and Rinus Plasmeijer. The ins and outs of Clean I/O. Journal of Functional Programming, 5(1):81--110, 1995.]]
[2]
Alex Aiken, Manuel Fähndrich, and Raph Levien. Better static memory management: Improving region-based analysis of higher-order languages. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI), pages 174--185, 1995.]]
[3]
Alex Aiken, Jeffrey S. Foster, John Kodumal, and Tachio Terauchi. Checking and inferring local non-aliasing. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI), pages 129--140, June 2003.]]
[4]
Henry Baker. Lively linear LISP---look ma, no garbage. ACM SIGPLAN Notices, 27(8):89--98, 1992.]]
[5]
Gregory Bellella, editor. The Real-Time Specification for Java. Addison-Wesley, 2000.]]
[6]
Hans-Juergen Boehm and Mark Weiser. Garbage collection in an uncooperative environment. Software -- Practice and Experience, 18(9):807--820, 1988.]]
[7]
Chandrasekhar Boyapati, Alexandru Salcianu, William Beebee, and Martin Rinard. Ownership types for safe region-based memory management in real-time Java. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI), pages 324--337, June 2003.]]
[8]
John Boyland Alias burying: Unique variables without destructive reads. Software -- Practice and Experience, 31(6):533--553, 2001.]]
[9]
Dave Clarke and Tobias Wrigstad. External uniqueness is unique enough. In European Conference on Object-Oriented Programming (ECOOP), pages 176--200, July 2003.]]
[10]
Cyclone, version 0.8. Available at http://www.eecs.harvard.edu/~greg/cyclone/.]]
[11]
Robert DeLine and Manuel Fähndrich. Enforcing high-level protocols in low-level software. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI), pages 59--69, June 2001.]]
[12]
Manuel Fähndrich and Robert DeLine. Adoption and focus: Practical linear types for imperative programming. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI), pages 13--24, June 2002.]]
[13]
Matthew Fluet and Daniel Wang. Implementation and performance evaluation of a safe runtime system in Cyclone. In Informal Proceedings of the SPACE 2004 Workshop, January 2004.]]
[14]
David Gay and Alex Aiken. Language support for regions. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI), pages 70--80, June 2001.]]
[15]
Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James Cheney. Region-based memory management in Cyclone. In Proc. ACM Conference on Programming Language Design and IImplementation (PLDI), pages 282--293, June 2002.]]
[16]
Niels Hallenberg, Martin Elsman, and Mads Tofte. Combining region inference and garbage collection. In Proc. ACM Conference on Programming Language Design and Implementation (PLDI) pages 141--152, June 2002.]]
[17]
Douglas Harms and Bruce Weide. Copying and swapping: Influences on the design of reusable software components. IEEE Transactions on Software Engineering, 17(5):424--435, May 1991.]]
[18]
Chris Hawblitzel. Adding Operating System Structure to Language-Based Protection. PhD thesis, June 2000.]]
[19]
Fritz Henglein, Henning Makholm, and Henning Niss. A direct approach to control-flow sensitive region-based memory anagement. In Proc. Principles and Practice of Declarative Programming (PPDP), pages 175--186, September 2001.]]
[20]
Maurice Herlihy. Wait-free synchronization. ACM Transactions on Programming Languages and Systems, 13(1):124--149, January 1991.]]
[21]
Matthew Hertz and Emery Berger. Automatic vs. explicit memory management: Settling the performance debate. Technical Report CS TR-04-17, University of Massachussetts Department of Computer Science, 2004.]]
[22]
Michael Hicks, Adithya Nagajaran, and Robbert van Renesse. MediaNet: User-defined adaptive scheduling for streaming data. In Proc. IEEE Conference on Open Architectures and Network Programming (OPENARCH), pages 87--96, April 2003.]]
[23]
Trevor Jim, Greg Morrisett, Dan Grossman, Michael Hicks, James Cheney, and Yanling Wang. Cyclone: A safe dialect of C. In Proc. USENIX Annual Technical Conference, pages 275--288, June 2002.]]
[24]
Doug Lea. A memory allocator. http://gee.cs.oswego.edu/dl/html/malloc.html.]]
[25]
David Mazières. A toolkit for user-level file systems. In Proc. USENIX Annual Technical Conference, pages 261--274, June 2001.]]
[26]
Mike Muuss. The story of TTCP. http://ftp.arl.mil/~mike/ttcp.html.]]
[27]
Niels Provos. libevent --- an event notification library. http://www.monkey.org/provos/libevent/.]]
[28]
Fred Smith, David Walker, and Greg Morrisett. Alias types. In Proc. European Symposium on Programming (ESOP), pages 366--381, March 2000.]]
[29]
Tachio Terauchi and Alex Aiken. Memory management with use-counted regions. Technical Report UCB//CSD-04-1314, University of California, Berkeley, March 2004.]]
[30]
Mads Tofte, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy Højfel Olesen, and Peter Sestoft. Programming with regions in the ML Kit (for version 4. Technical report, IT University of Copenhagen, September 2001.]]
[31]
Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109--176, February 1997.]]
[32]
Philip Wadler. Linear types can change the world! In Programming Concepts and Methods, April 1990. IFIP TC 2 Working Conference.]]
[33]
David Walker, Karl Crary, and Greg Morrisett. Typed memory management in a calculus of capabilities. ACM Transactions on Programming Languages and Systems, 24(4):701--771, July 2000.]]
[34]
David Walker and Greg Morrisett. Alias types for recursive data structures. In Proc. Workshop on Types in Compilation (TIC), pages 177--206, September 2000.]]
[35]
David Walker and Kevin Watkins. On regions and linear types. In Proc. ACM International Conference on Functional Programming (ICFP), pages 181--192, September 2001.]]
[36]
Daniel Wang and Andrew Appel. Type-preserving garbage collectors. In Proc. ACM Symposium n Principles of Programming Languages(POPL), pages 166--178, January 2001.]]
[37]
Hongwei Xi and Frank Pfenning. Dependent types in practical programming. pages 214--227, January 1999.]]
[38]
Benjamin G. Zorn. The measured cost of conservative garbage collection. Software - Practice and Experience, 23(7):733--756, 1993.]]

Cited By

View all
  • (2024)Functional Ownership through Fractional UniquenessProceedings of the ACM on Programming Languages10.1145/36498488:OOPSLA1(1040-1070)Online publication date: 29-Apr-2024
  • (2024)Explicit Effects and Effect Constraints in ReMLProceedings of the ACM on Programming Languages10.1145/36329218:POPL(2370-2394)Online publication date: 5-Jan-2024
  • (2024)rCanary: Detecting Memory Leaks Across Semi-Automated Memory Management Boundary in RustIEEE Transactions on Software Engineering10.1109/TSE.2024.344362450:9(2472-2484)Online publication date: 13-Aug-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ISMM '04: Proceedings of the 4th international symposium on Memory management
October 2004
182 pages
ISBN:1581139454
DOI:10.1145/1029873
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: 24 October 2004

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. cyclone
  2. memory management
  3. memory safety
  4. regions
  5. unique pointers

Qualifiers

  • Article

Conference

ISMM04
Sponsor:

Acceptance Rates

Overall Acceptance Rate 72 of 156 submissions, 46%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)14
  • Downloads (Last 6 weeks)3
Reflects downloads up to 16 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Functional Ownership through Fractional UniquenessProceedings of the ACM on Programming Languages10.1145/36498488:OOPSLA1(1040-1070)Online publication date: 29-Apr-2024
  • (2024)Explicit Effects and Effect Constraints in ReMLProceedings of the ACM on Programming Languages10.1145/36329218:POPL(2370-2394)Online publication date: 5-Jan-2024
  • (2024)rCanary: Detecting Memory Leaks Across Semi-Automated Memory Management Boundary in RustIEEE Transactions on Software Engineering10.1109/TSE.2024.344362450:9(2472-2484)Online publication date: 13-Aug-2024
  • (2023)Reference Capabilities for Flexible Memory ManagementProceedings of the ACM on Programming Languages10.1145/36228467:OOPSLA2(1363-1393)Online publication date: 16-Oct-2023
  • (2022)Linearity and Uniqueness: An Entente CordialeProgramming Languages and Systems10.1007/978-3-030-99336-8_13(346-375)Online publication date: 29-Mar-2022
  • (2021)A Lightweight Formalism for Reference Lifetimes and Borrowing in RustACM Transactions on Programming Languages and Systems10.1145/344342043:1(1-73)Online publication date: 17-Apr-2021
  • (2018)A practical type system for safe aliasingProceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3276604.3276612(133-146)Online publication date: 24-Oct-2018
  • (2018)Understanding and Combating Memory Bloat in Managed Data-Intensive SystemsACM Transactions on Software Engineering and Methodology10.1145/316262626:4(1-41)Online publication date: 3-Jan-2018
  • (2017)NG2C: pretenuring garbage collection with dynamic generations for HotSpot big data applicationsACM SIGPLAN Notices10.1145/3156685.309227252:9(2-13)Online publication date: 18-Jun-2017
  • (2017)Project snowflake: non-blocking safe manual memory management in .NETProceedings of the ACM on Programming Languages10.1145/31418791:OOPSLA(1-25)Online publication date: 12-Oct-2017
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media