Abstract
We present a type system for a compile-time analysis of heap-space requirements of Java style object-oriented programs with explicit deallocation.
Our system is based on an amortised complexity analysis: the data is arbitrarily assigned a potential related to its size and layout; allocations must be “payed for” from this potential. The potential of each input then furnishes an upper bound on the heap space usage for the computation on this input.
We successfully treat inheritance, downcast, update and aliasing. Example applications for the analysis include destination-passing style and doubly-linked lists.
Type inference is explicitly not included; the contribution lies in the system itself and the nontrivial soundness theorem. This extended abstract elides most technical lemmas and proofs, even nontrivial ones, due to space limitations. A full version is available at the authors’ web pages.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Berger, E.D., Zorn, B.G., McKinley, K.S.: Reconsidering custom memory allocation. In: Proceedings of the Conference on Object-Oriented Programming: Systems, Languages, and Applications, OOPSLA (2002)
Bozga, M., Iosif, R., Laknech, Y.: Storeless semantics and alias logic. In: Proceedings of the 2003 ACM SIGPLAN workshop on Partial evaluation and semanticsbased program manipulation (PEPM), pp. 55–65. ACM, New York (2003)
Chin, W.-N., Nguyen, H.H., Qin, S.C., Rinard, M.: Memory usage verification for OO programs. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 70–86. Springer, Heidelberg (2005)
Deutsch, A.: Interprocedural may-alias analysis for pointers: beyond k-limiting. ACM SIGPLAN Notices 29(6), 230–241 (1994)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 171–183 (1998)
Galland, A., Baudet, M.: Controlling and Optimizing the Usage of One Resource. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 195–211. Springer, Heidelberg (2003)
Gömez, G., Liu, Y.A.: Automatic time-bound analysis for a higher-order language. In: Proceedings of the 2002 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation, pp. 75–86. ACM Press, New York (2002)
Grobauer, B.: Topics in Semantics-based Program Manipulation. PhD thesis, BRICS Aarhus (2001)
Hofmann, M., Jost, S.: Static prediction of heap space usage for first-order functional programs. In: Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 185–197. ACM, New York (2003)
Hughes, J., Pareto, L.: Recursion and dynamic data structures in bounded space: towards embedded ML programming. In: Proc. International Conference on Functional Programming (ICFP), Paris, September 1999, pp. 70–81 (1999)
Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. In: Meissner, L. (ed.) Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages & Applications (OOPSLA), New York, vol. 34(10), pp. 132–146 (1999)
Ishtiaq, S.S., O’Hearn, P.W.: BI as an assertion language for mutable data structures. In: Proceedings of the 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 14–26. ACM, New York (2001)
Jonkers, H.: Abstract storage structures. In: de Bakker, J.W., van Vliet, J.C. (eds.) Algorithmic Languages, pp. 321–343. IFIP, North Holland (1981)
Krone, J., Ogden, W.F., Sitaraman, M.: Modular verification of performance constraints. Technical report, Dep. of Comp. Sci., Clemson University (May 2003)
Rinetzky, N., Bauer, J., Reps, T., Sagiv, M., Wilhelm, R.: A semantics for procedure local heaps and its abstractions. In: Proceedings of the 32nd ACM SIGPLANSIGACT Symposium on Principles of Programming Languages (POPL), pp. 296–309. ACM Press, New York (2005)
Talpin, J.-P., Jouvelot, P.: Polymorphic type, region and effect inference. J. Funct. Program. 2(3), 245–271 (1992)
Tarjan, R.E.: Amortized computational complexity. SIAM Journal on Algebraic and Discrete Methods 6(2), 306–318 (1985)
Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N., Olesen, T., Sestoft, P.: Programming with regions in the ml kit. IT University of Copenhagen (April 2002), http://www.itu.dk/research/mlkit/
Tofte, M., Talpin, J.-P.: Region-based memory management. Information and Computation 132(2), 109–176 (1997)
Unnikrishnan, L., Stoller, S.D., Liu, Y.A.: Automatic accurate live memory analysis for garbage-collected languages. In: Proceedings of The Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES), ACM, New York (2001)
Vasconcelos, P.: Space Cost Modeling for Concurrent Resource Sensitive Systems. PhD thesis, School of Comp. Sci., University of St Andrews, Scotland (to appear)
Walker, D.W., Morrisett, G.: Alias types for recursive data structures. In: Harper, R. (ed.) TIC 2000. LNCS, vol. 2071, p. 177. Springer, Heidelberg (2001)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hofmann, M., Jost, S. (2006). Type-Based Amortised Heap-Space Analysis. In: Sestoft, P. (eds) Programming Languages and Systems. ESOP 2006. Lecture Notes in Computer Science, vol 3924. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11693024_3
Download citation
DOI: https://doi.org/10.1007/11693024_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33095-0
Online ISBN: 978-3-540-33096-7
eBook Packages: Computer ScienceComputer Science (R0)