Two problems with heap profiling

Stefan Reich doc at drjava.de
Fri Apr 16 12:38:59 EDT 2004


I'm using GHC 6.2.1 on Windows 2000.

Problem 1: -hr crashes in some circumstances.

Take this program (Test.hs):

  module Main where
  import IO
  main = do
    readFile "large.csv"
    putStrLn "OK"

where large.csv is an 800K CSV file (with very small files, the bug 
doesn't occur). I compile with:

    ghc -prof -auto-all Test.hs

and run with:

    a.out +RTS -hr

and get a Windows error message indicating that the program had to be 
terminated. The "OK" appears, though. When I run the test program 
repeatedly, it sometimes works fine (which is not the case for the 
real-world program I'm trying to profile).

Other options (-hc, -hy etc) work fine. Unfortunately, retainer 
information is the most useful of them all...

Problem 2: hp2ps doesn't work at all. When trying to read this file 
(a.out.hp):

JOB "a.out +RTS -hr
"
DATE "Fri Apr 16 11:15 2004"
SAMPLE_UNIT "seconds"
VALUE_UNIT "bytes"
BEGIN_SAMPLE 0.00
END_SAMPLE 0.00
BEGIN_SAMPLE 0,01
END_SAMPLE 0,01

it says "a.out.hp, line 7, floating point number must follow 
BEGIN_SAMPLE". I assume the apparently mixed English/German number 
formatting causes this problem.

-Stefan



More information about the Glasgow-haskell-users mailing list