A perspective on the AHA project Alejandro Tamalet, Olha Shkaravska, and Marko van Eekelen Institute for Computing and Information Sciences Radboud University Nijmegen {tamalet, shkarav, marko}@cs.ru.nl Abstract The Amortised Heap Space Usage Analysis (AHA) project [4] aims at statically estimating heap consumption of programs. At this workshop we will give an overview of our achievements and we will comment on our current research and future plans. Memory management is a key concern for many kinds of applications. An important aspect of memory management is a having a safe estimation of the amount of memory required for program execution. Overallocation of memory is inefficient, while underallocation may cause failure or degradation of the system. From a security point of view, memory exhaustion can be exploited by denial of service attacks. This applies to programs running on resource-constrained devices like mobile phones as well as to grid computing. Combining amortisation with type theory allows to infer linear bounds on heap consumption of functional programs with explicit memory deallocation [1]. The AHA project aims to adapt this method for non-linear bounds within func- tional programs and to transfer the results to the object-oriented programming. Contrary to linear amortised bounds, to obtain non-linear heap estimates one needs to know the sizes of the structures that take part in the computations [4]. Our approach is to use a type system with size annotations. We have de- veloped a type system for a first-order polymorphic functional language, where size annotations are polynomials [2]. With this type system we can express the dependency between the size of the input to a function and the size of its output. The dependency must be exact, not just an upper bound. A novel feature of this type system is that it does not require the polynomials to be monotonic. We have shown that type checking is undecidable in general, but we have proven decidability for a large class of programs. As regards type inference, we have developed a dynamic semi-algorithm to infer polynomial sizes [5]. The basic steps are (i) propose a degree for the polyno- mial (ii) through testing, determine its coefficients (iii) type check the candidate type. If it fails, propose another degree. The procedure is dynamic in the sense that it executes the function to obtain a system of linear equations, from which This work is sponsored by the Netherlands Organisation for Scientific Research (NWO) under grant 612.063.511.