1 Dec 2003 01:16
Re: ERROR - Garbage collection fails to reclaim sufficient space
Sigbjorn Finne <sof <at> galois.com>
2003-12-01 00:16:07 GMT
2003-12-01 00:16:07 GMT
To improve on the behaviour you're seeing, you either have to up the heap size (via :set -h), or fix the space leak in your program (*). Hugs doesn't dynamically expand the size of its heap. --sigbjorn * - here's one possible solution to letting go of input file data in a timely fashion: > collectAllData :: [String] -> -- A list of filenames > IO [String] -- A list of results > > collectAllData xs = mapM collectFileData xs >>= return.concat > > collectFileData :: String -> IO [String] > collectFileData fn = do > putStrLn $ "Reading: " ++ fn > contents <- readFile fn > case parseIt contents of > (a,b) | seqList a && seqList b -> return [fn,a,b,""] > where > parseIt cs = > parseFile $ > filter (/= "") $ > lines cs > > seqList :: [a] -> Bool > seqList [] = True > seqList (x:xs) = x `seq` seqList xs(Continue reading)
Cheers,
S.
RSS Feed