Opened 7 years ago

Closed 6 years ago

#7363 closed bug (worksforme)

runghc leaks space in IO

Reported by: Jafet Owned by: igloo
Priority: normal Milestone: 7.8.1
Component: None Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

runghc mysteriously uses memory to perform IO.

main = forever $ return ()
main = sequence_ $ repeat $ return ()
main = mapM_ print [0..]
-- et al.

I have encountered this bug with 7.4.2 on Windows and linux, and 7.6.1 on linux.

This only seems to happen with runghc, not with ghci or ghc -e.

I don't know what Component contains runghc, so I have left it blank for now.

Change History (2)

comment:1 Changed 6 years ago by igloo

difficulty: Unknown
Milestone: 7.8.1
Owner: set to igloo

Thanks for the report. That sounds odd; I'll take a look.

comment:2 Changed 6 years ago by igloo

Resolution: worksforme
Status: newclosed

I can reproduce the memory usage with runghc, but also with

ghc q.hs -e main

(perhaps when you tested, you were picking up compiled code rather than interpreting?) so I think this is just the memory usage of interpreted, non-optimised code.

If you still think there's something fishy going on, please reopen and give exactly what sources you're using and what commands you're running, so that I can try to reproduce it.

Note: See TracTickets for help on using tickets.