1 --!!! Testing the garbage collector
4 -- All these tests should be run in a freshly started system
5 -- and with the specified heap size/ heap configuration.
7 -- (Of course, they should run successfully in a non-fresh system,
8 -- with different heap sizes, etc. - but they've been known to fail
9 -- with the specified size.)
12 -- build Hugs with all gc tests turned on and run with a small heap.
14 -- 27/11/95: This test works fine - but fails when entered on the
15 -- command line. The difference must be that the top level
16 -- thunk isn't being treated as a root by the GC system.
17 -- 3/6/96: Requires 210kbyte heap to run - which is double the size of
18 -- the string it generates. This has to get stored since
19 -- test1 is a CAF and the 2-space GC doubles the requirement.
20 -- If evaluated on the command line, it runs in 16kbytes
21 -- which is about the smallest possible heap given the
22 -- setting of minRecovery (1000), the size of a cell (8 bytes)
23 -- and the GC's need for two equally size semispaces.
24 test1 = show [1..1500]
26 -- 27/11/95: This test produces different results on command line
27 -- and when executed as given. Again, I think I'm failing to make
28 -- the top-level object a root.
29 -- 20/5/96: This test runs out of space - I think black holing would fix it.
30 -- 3/6/96: Now works fine. Nothing to do with blackholing! All I had to do
31 -- was restore Mark's definitions of sum and product. These used
32 -- foldl' which is a strict version of foldl.
33 test2 = show (sum [1..100000])