Re: ERROR - Garbage collection fails to reclaim sufficient space

"Sigbjorn Finne" <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <005a01c3b7a0$5123b1d0$6501a8c0@snapdragon>
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 <[email protected]> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.