[Haskell-cafe] Re: Top Level <-

Ganesh Sittampalam ganesh at earth.li
Sat Sep 6 04:15:52 EDT 2008


On Sat, 6 Sep 2008, Ashley Yakeley wrote:

> Ganesh Sittampalam wrote:
>>> But it's limited to the initialisers. An IORef holding an Integer isn't 
>>> much memory, and it only ever gets leaked once.
>
>> It happens every time you load and unload, surely?
>
> No. An initialiser is only ever run once per run of the RTS.

Oh, I see. Yes, sorry.

> Since it's of the order of the number of uniquely identified 
> initialisers, it's arguably not a memory leak so much as a static 
> overhead. The only way to get a continuous leak is to load and unload an 
> endless stream of _different_ modules, each with their own initialisers.

I would call it a leak if something that is no longer being used cannot be 
reclaimed. The endless stream of different modules is possible in 
long-running systems where the code being run evolves or changes over time 
(e.g. something like lambdabot, which runs user-provided code).

Cheers,

Ganesh


More information about the Haskell-Cafe mailing list