Opened 12 months ago

Last modified 12 months ago

#16011 new bug

GHCi leaks memory even with -fno-it.

Reported by: AndreasK Owned by:
Priority: normal Milestone:
Component: GHCi Version: 8.7
Keywords: Cc: osa1
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #15503 Differential Rev(s):
Wiki Page:

Description

GHCi leaks are not exactly new, but this one is especially easy to trigger/reproduce.

The memory allocated by f never gets freed.

PS E:\binary-perf> ..\ghc-8.6.1\bin\ghci.exe -fno-it
GHCi, version 8.6.1: http://www.haskell.org/ghc/  :? for help
Prelude> f = [1 .. 20000000] :: [Int]
Prelude> length f
20000000
Prelude> f = [1 .. 20000001] :: [Int]
Prelude> length f
20000001
Prelude> f = [1 .. 20000002] :: [Int]
Prelude> length f
20000002
Prelude> f = [1 .. 20000000] :: [Int]
Prelude> length f
20000000
Prelude>

Or using head and even simpler:

PS E:\binary-perf> ..\ghc_commonAsm\inplace\bin\ghci.exe -fno-it
GHCi, version 8.7.20181207: http://www.haskell.org/ghc/  :? for help
Loaded package environment from E:\binary-perf\.ghc.environment.x86_64-mingw32-8.7.20181207
Prelude> f = replicate 2000000 False
Prelude> length f
2000000
Prelude> f = replicate 2000000 False
Prelude> length f
2000000
Prelude> f = replicate 2000000 False
Prelude> length f
2000000
Prelude> f = replicate 2000000 False
Prelude> length f

GHC just keeps using more and more memory when I repeat this.

Change History (3)

comment:1 Changed 12 months ago by bgamari

Milestone: 8.6.3

Ticket retargeted after milestone closed

comment:2 Changed 12 months ago by osa1

Cc: osa1 added

comment:3 Changed 12 months ago by osa1

Note: See TracTickets for help on using tickets.