1 @HpView.lhs@ is a very primitive heap profile viewer written in
2 Haskell. It feeds off the same files as hp2ps. It needs a lot of
3 tidying up and would be far more useful as a continuous display.
4 (It's in this directory `cos there happens to be a heap profile here
5 and I couldn't be bothered setting up a new directory, Makefile, etc.)
7 @Graph.lhs@ is a continuous heap viewer that "parses" the output of
8 the +RTS -Sstderr option. Typical usage:
10 slife 1 r4 +RTS -Sstderr |& graph 2
16 to see it in action on some sample data.
21 1) Scaling varies from column to column - consult the source.
23 2) The horizontal scale is not time - it is garbage collections.
25 3) The graph is of the (n+1)st column of the -Sstderr output.
27 The data is not always incredibly useful: For example, when using
28 the (default) Appel 2-space garbage collector, the 3rd column
29 displays the amount of "live" data in the minor space. A program
30 with a constant data usage will appear to have a sawtooth usage
31 as minor data gradually transfers to the major space and then,
32 suddenly, all gets transferred back at major collections.
33 Decreasing heap size decreases the size of the minor collections
34 and increases major collections exaggerating the sawtooth.
36 4) The program is not as robust as it might be.
39 @HpView2.lhs@ is the result of a casual coupling of @Graph.lhs@ and
40 @HpView.lhs@ which draws continuous graphs of the heap consisting of:
41 total usage and usage by one particular cost centre. For example:
44 hpView2 slife.hp Main:mkQuad &
45 slife 2 Unis/gardenofeden +RTS -h -i0.1 -RTS
48 draws a graph of total usage and usage by the function @mkQuad@.
52 hpView2 slife.old-hp Main:mkQuad
54 to see it in action on some older data)
56 The business with named pipes (mkfifo) is a little unfortunate - it
57 would be nicer if the Haskell runtime system could output to stderr
58 (say) which I could pipe into hpView which could just graph it's stdin
59 (like graph does). It's probably worth wrapping the whole thing up in
60 a little shell-script.