Hello hugs-bugs-request,
Sunday, March 23, 2003, 4:25:54 AM, you wrote:
The following program:
------------------------------------
module StringSolver(
fixedp,
freep,
connstr,
solvestrings
) where
-- start end length needed
data ConnStr = ConnStr Int Int Double
type V3 = (Double,Double,Double)
data Point =
FixedP V3 -- point that cannot move
| FreeP V3 -- point that we compute.
deriving Show
connstr = ConnStr
fixedp = FixedP
freep = FreeP
step = 0.01
deltasq = d*d
where
d = step
verysmall = 0.000000000000001
sub3v (x,y,z) (x',y',z') = (x-x',y-y',z-z')
add3v (x,y,z) (x',y',z') = (x+x',y+y',z+z')
mul3vsc (x,y,z) sc = (x*sc,y*sc,z*sc)
inprod (x,y,z) (x',y',z') = x*x'+y*y'+z*z'
distsq a b = let d=sub3v a b in inprod d d
dist a b = sqrt $ distsq a b
lenv3 = dist (0,0,0)
normv3 a = let
d = lenv3 a
n = 1/sqrt(d)
in
if d
Serguey Zefirov
[huge program deleted]
gives "Garbage collection fails to reclaim sufficient space." when loaded into Hugs Nov 2002 and asked to run "test".
I think it shouldn't do that.
It sound like your program has a space leak. I recommend profiling it using ghc, ghci or nhc which have excellent space profiling tools in them. If nothing else, running it with another compiler would provide independent confirmation that the problem is in the compiler or in the program. -- Alastair Reid alastair@reid-consulting-uk.ltd.uk Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/
participants (2)
-
Alastair Reid -
Serguey Zefirov