Abstract
A heap profile is a chart showing the contents of heap memory throughout a computation. Contents are depicted abstractly by showing how much space is occupied by memory cells in each of several classes. A good heap profiler can use a variety of attributes of memory cells to define a classification. Effective profiling usually involves a combination of attributes. The ideal profiler gives full support for combination in two ways. First, a section of the heap of interest to the programmer can be specified by constraining the values of any combination of cell attributes. Secondly, no matter what attributes are used to specify such a section, a heap profile can be obtained for that section only, and any other attribute can be used to define the classification. Achieving this ideal is not simple for some combinations of attributes. A heap profile is derived by interpolation of a series of censuses of heap contents at different stages. The obvious way to obtain census data is to traverse the live heap at intervals throughout the computation. This is fine for static attributes (eg. What type of value does this memory cell represent?), and for dynamic attributes that can be determined for each cell by examining the heap at any given moment (eg. From which function closures can this cell be reached?). But some attributes of cells can only be determined retrospectively by post-mortem inspection as a cell is overwritten or garbage-collected (eg. Is this cell ever used again?). Now we see the problem: if a profiler supports both live and post-mortem attributes, how can we implement the ideal of unrestricted combinations? That is the problem we solve in this paper. We give techniques for profiling a heap section specified in terms of both live and post-mortem attributes. We show how to generate live-attribute profiles of a section of the heap specified using post-mortem attributes, and vice versa.
Preview
Unable to display preview. Download preview PDF.
References
Hartel, P.H., Veen, A.H.: Statistics on graph reduction of SASL programs. Software — Practice and Experience, 18:239–253, 1988.
Ripley, G.D., Griswold, R.E., Hanson, D.R.: Performance of storage management in an implementation of SNOBOL4. IEEE Transactions on Software Engineering, SE-4:130–137, 1978.
Runciman, C. and Röjemo, N.: New dimensions in heap profiling. Journal of Functional Programming, 6(4):587–620, 1996.
Runciman, C. and Röjemo, N.: Heap profiling for space efficiency. In 2nd Intl. School on Advanced Functional Programming, pages 159–183. Springer LNCS 1129, 1996.
Runciman, C. and Wakeling, D.: Heap profiling of lazy functional programs. Journal of Functional Programming, 3(2):217–245, 1993.
Röjemo, N. and Runciman, C.: Lag, drag, void and use — heap profiling and space-efficient compilation revisited. In Proc. Intl. Conf. on Functional Programming, pages 34–41. ACM Press, 1996.
Sansom, P.M.: Execution profiling for non-strict functional languages. Ph.D. thesis, Computing Science, University of Glasgow, UK, 1994.
Sansom, P.M., Peyton Jones, S.L.: Time and space profiling for non-strict higher-order functional languages. Proc. A CM Conf. on Principles of Programming Languages (POPL'95), pages 355–366, ACM Press, 1995.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Runciman, C., Röjemo, N. (1997). Two-pass heap profiling: A matter of life and death. In: Kluge, W. (eds) Implementation of Functional Languages. IFL 1996. Lecture Notes in Computer Science, vol 1268. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-63237-9_27
Download citation
DOI: https://doi.org/10.1007/3-540-63237-9_27
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63237-5
Online ISBN: 978-3-540-69239-3
eBook Packages: Springer Book Archive