ERROR - Garbage collection fails to reclaim sufficient space

Sigbjorn Finne sof at galois.com
Sun Nov 30 16:16:07 EST 2003


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


Henk-Jan.van.Tuyl <Henk-Jan.van.Tuyl at hotpop.com> wrote:
>> L.S.,
>> 
>> When reading a lot of files, Hugs gives the message:
>>    ERROR - Garbage collection fails to reclaim sufficient space
>> 
>> I had this problem before with Hugs Version Nov 2002 after 40 files,
>> now with Hugs Version Nov 2003, it happens after 60 or 61 files; see
>> the attached program. If you want sample data files, just ask me.  
>> 
>> --
>> Best regards,
>> Henk-Jan van Tuyl
> 



More information about the Hugs-Bugs mailing list