Abstract
We present a new type system for an object-oriented (OO) language that characterizes the sizes of data structures and the amount of heap memory required to successfully execute methods that operate on these data structures. Key components of this type system include type assertions that use symbolic Presburger arithmetic expressions to capture data structure sizes, the effect of methods on the data structures that they manipulate, and the amount of memory that methods allocate and deallocate. For each method, we conservatively capture the amount of memory required to execute the method as a function of the sizes of the method’s inputs. The safety guarantee is that the method will never attempt to use more memory than its type expressions specify. We have implemented a type checker to verify memory usages of OO programs. Our experience is that the type system can precisely and effectively capture memory bounds for a wide range of programs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aldrich, J., Kostadinov, V., Chambers, C.: Alias Annotation for Program Understanding. In: ACM OOPSLA, Seattle, Washington (November 2002)
Alpern, B., Attanasio, D., Barton, J.J., Cocchi, A., Hummel, S.F., Lieber, D., Mergen, M., Ngo, T., Shepherd, J., Smith, S.: Implementing Jalapeño in Java. In: ACM OOPSLA, Denver, Colorado (November 1999)
Aspinall, D., Compagnoni, A.: Heap bounded assembly language. Journal of Automated Reasoning 31, 261–302 (2003)
Berger, E.D., Zorn, B.G., Mckinley, K.S.: Reconsidering Custom Memory Allocation. In: ACM OOPSLA (November 2002)
Boyland, J., Noble, J., Retert, W.: Capabilities for sharing. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, p. 2. Springer, Heidelberg (2001)
Cachera, D., Jensen, T., Pichardie, D., Schneider, G.: Certified memory usage analysis. In: Fitzgerald, J.S., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 91–106. Springer, Heidelberg (2005)
Carlisle, M.C., Rogers, A.: Software caching and computation migration in Olden. In: 4th Principles and Practice of Parallel Programming, Santa Barbara, California (May 1993)
Chan, E.C., Boyland, J., Scherlis, W.L.: Promises: Limited Specifications for Analysis and Manipulation. In: Proceedings of the International Conference on Software Engineering, Kyoto, Japan, April 1998, pp. 167–176 (1998)
Chin, W.N., Khoo, S.C., Qin, S.C., Popeea, C., Nguyen, H.H.: Verifying Safety Policies with Size Properties and Alias Controls. In: Inverardi, P., Jazayeri, M. (eds.) ICSE 2005. LNCS, vol. 4309, Springer, Heidelberg (2006)
Chin, W.N., Nguyen, H.H., Qin, S.C., Rinard, M.: Predictable Memory Usage for Object-Oriented Programs. Technical report, SoC, Natl Univ. of Singapore (November 2004), avail. at, http://www.dur.ac.uk/shengchao.qin/papers/memj.ps.gz
Christiansen, M.V., Velschow, P.: Region-Based Memory Management in Java. Master’s Thesis, Department of Computer Science (DIKU), University of Copenhagen (1998)
Fahndrich, M., Leino, R.: Declaring and checking non-null types in an object-oriented language. In: ACM OOPSLA, Anaheim, CA (October 2003)
Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)
Hofmann, M., Jost, S.: Static prediction of heap space usage for first order functional programs. In: ACM POPL, New Orleans, Louisiana (January 2003)
Hughes, J., Pareto, L.: Recursion and Dynamic Data-Structures in Bounded Space: Towards Embedded ML Programming. In: Proceedings of the International Conference on Functional Programming (ICFP 1999) (September 1999)
IBM. JikesTM Research Virtual Machine (RVM), http://www-124.ibm.com/developerworks/oss/jikesrvm/
Lamport, L.: The temporal logic of actions. ACM Trans. on Programming Languages and Systems 16(3), 872–923 (1994)
Peyton-Jones, S., et al.: Glasgow Haskell Compiler, http://www.haskell.org/ghc
Pugh, W.: The Omega Test: A fast practical integer programming algorithm for dependence analysis. Communications of the ACM 8, 102–114 (1992)
Tofte, M., Talpin, J.: Region-based memory management. Information and Computation 132(2) (1997)
Xi, H., Pfenning, F.: Eliminating array bound checking through dependent types. In: ACM PLDI, June 1998. ACM Press, New York (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chin, WN., Nguyen, H.H., Qin, S., Rinard, M. (2005). Memory Usage Verification for OO Programs. In: Hankin, C., Siveroni, I. (eds) Static Analysis. SAS 2005. Lecture Notes in Computer Science, vol 3672. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11547662_7
Download citation
DOI: https://doi.org/10.1007/11547662_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-28584-7
Online ISBN: 978-3-540-31971-9
eBook Packages: Computer ScienceComputer Science (R0)