What to do when garbage collector is slow?

David Spies dnspies at gmail.com
Tue Dec 23 10:59:28 UTC 2014


I have a program that, to all appearances, is behaving properly.  It uses
very little memory to run, it has the profile I would expect looking at
+RTS -hc.  I have no reason to believe there is a memory leak (in the sense
that it's not lazily holding on to things it no longer needs or strictly
generating things it doesn't need yet).  But it's slow, and according to
-sstderr, most of the time is spent garbage-collecting.

Why is the garbage-collector consuming so much running time? How can I deal
with it?

The program is a solution to this problem:
https://open.kattis.com/problems/tourist

The input data can be found here:
http://heim.ifi.uio.no/~db/nm-i-programmering/nm2004/testdata/h.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20141223/c88f0bce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.hs
Type: text/x-haskell
Size: 2442 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20141223/c88f0bce/attachment.hs>


More information about the Glasgow-haskell-users mailing list