Clark Gaebel | 22 Apr 21:54 2013
Picon
Picon

Monad Transformer Space Leak

Hi everyone!


For some reason, this leaks thunks:

module Main where

import Control.Monad
import Control.Monad.MC -- from monte-carlo
import Control.Monad.ST.Strict

go :: Int -> MCT (ST s) ()
go k = replicateM_ k (return ())

main = print $ runST $ evalMCT (go 100000000) rng
    where
        rng = mt19937 0

while this does not:

module Main where

import Control.Monad

go :: Int -> MC ()
go k = replicateM_ k (return ())

main = print $ evalMC (go 100000000) rng
    where
        rng = mt19937 0

Can anyone help me figure out what's going on here?

Thanks,
  - Clark
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Clark Gaebel | 22 Apr 22:44 2013
Picon
Picon

Re: Monad Transformer Space Leak

More interestingly, the problem goes away if I enable profiling. That's kind of worrisome.


  - Clark

On Monday, April 22, 2013, Clark Gaebel wrote:
Hi everyone!

For some reason, this leaks thunks:

module Main where

import Control.Monad
import Control.Monad.MC -- from monte-carlo
import Control.Monad.ST.Strict

go :: Int -> MCT (ST s) ()
go k = replicateM_ k (return ())

main = print $ runST $ evalMCT (go 100000000) rng
    where
        rng = mt19937 0

while this does not:

module Main where

import Control.Monad

go :: Int -> MC ()
go k = replicateM_ k (return ())

main = print $ evalMC (go 100000000) rng
    where
        rng = mt19937 0

Can anyone help me figure out what's going on here?

Thanks,
  - Clark
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Joachim Breitner | 22 Apr 23:00 2013
Picon

Re: Monad Transformer Space Leak

Hi,

Am Montag, den 22.04.2013, 16:44 -0400 schrieb Clark Gaebel:
> More interestingly, the problem goes away if I enable profiling.
> That's kind of worrisome.

this part sounds similar than the recently discussed problem with the
ackermann function (http://hackage.haskell.org/trac/ghc/ticket/7850) –
maybe your code is only allocating stacks and nothing else? In that case
you can try with GHC HEAD and see if the problem is fixed.

Greetings,
Joachim

--

-- 
Joachim "nomeata" Breitner
Debian Developer
  nomeata <at> debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata <at> joachim-breitner.de | http://people.debian.org/~nomeata

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Clark Gaebel | 22 Apr 23:21 2013
Picon
Picon

Re: Monad Transformer Space Leak

I don't have a copy of GHC HEAD handy, and don't have the time to set up the ecosystem myself to test this one bug.

Would someone else with a copy lying around mind testing it out for me?

Thanks,
  - Clark

On Monday, April 22, 2013, Joachim Breitner wrote:
Hi,

Am Montag, den 22.04.2013, 16:44 -0400 schrieb Clark Gaebel:
> More interestingly, the problem goes away if I enable profiling.
> That's kind of worrisome.

this part sounds similar than the recently discussed problem with the
ackermann function (http://hackage.haskell.org/trac/ghc/ticket/7850) –
maybe your code is only allocating stacks and nothing else? In that case
you can try with GHC HEAD and see if the problem is fixed.

Greetings,
Joachim


--
Joachim "nomeata" Breitner
Debian Developer
  nomeata <at> debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata <at> joachim-breitner.de | http://people.debian.org/~nomeata

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Petr Pudlák | 23 Apr 09:36 2013
Picon

Re: Monad Transformer Space Leak

I tested it on GHC 6.12.1, which wasn't affected by the recent "ackermann" bug, but still it leaks memory.

Petr Pudlak


2013/4/22 Clark Gaebel <cgaebel <at> uwaterloo.ca>
I don't have a copy of GHC HEAD handy, and don't have the time to set up the ecosystem myself to test this one bug.

Would someone else with a copy lying around mind testing it out for me?

Thanks,
  - Clark

On Monday, April 22, 2013, Joachim Breitner wrote:
Hi,

Am Montag, den 22.04.2013, 16:44 -0400 schrieb Clark Gaebel:
> More interestingly, the problem goes away if I enable profiling.
> That's kind of worrisome.

this part sounds similar than the recently discussed problem with the
ackermann function (http://hackage.haskell.org/trac/ghc/ticket/7850) –
maybe your code is only allocating stacks and nothing else? In that case
you can try with GHC HEAD and see if the problem is fixed.

Greetings,
Joachim


--
Joachim "nomeata" Breitner
Debian Developer
  nomeata <at> debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata <at> joachim-breitner.de | http://people.debian.org/~nomeata


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Tom Ellis | 23 Apr 10:04 2013
Picon

Re: Monad Transformer Space Leak

On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
> I tested it on GHC 6.12.1, which wasn't affected by the recent "ackermann"
> bug, but still it leaks memory.

I tested it on GHC 7.4.1 and I don't see any space leak.
Clark Gaebel | 23 Apr 16:16 2013
Picon
Picon

Re: Monad Transformer Space Leak

I'm on 7.6.2, and it does. Oh no.

  - Clark

On Tuesday, April 23, 2013, Tom Ellis wrote:
On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
> I tested it on GHC 6.12.1, which wasn't affected by the recent "ackermann"
> bug, but still it leaks memory.

I tested it on GHC 7.4.1 and I don't see any space leak.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Niklas Hambüchen | 19 Jul 04:07 2013

Re: Monad Transformer Space Leak

Did you file this as a bug?

On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote:
> I'm on 7.6.2, and it does. Oh no.
>
>   - Clark
>
> On Tuesday, April 23, 2013, Tom Ellis wrote:
>
>     On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
>     > I tested it on GHC 6.12.1, which wasn't affected by the recent
>     "ackermann"
>     > bug, but still it leaks memory.
>
>     I tested it on GHC 7.4.1 and I don't see any space leak.
>
>     _______________________________________________
>     Haskell-Cafe mailing list
>     Haskell-Cafe <at> haskell.org <javascript:;>
>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Clark Gaebel | 19 Jul 04:10 2013
Picon
Picon

Re: Monad Transformer Space Leak

No I haven't.

  - Clark

On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen <mail <at> nh2.me> wrote:
> Did you file this as a bug?
>
> On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote:
>> I'm on 7.6.2, and it does. Oh no.
>>
>>   - Clark
>>
>> On Tuesday, April 23, 2013, Tom Ellis wrote:
>>
>>     On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
>>     > I tested it on GHC 6.12.1, which wasn't affected by the recent
>>     "ackermann"
>>     > bug, but still it leaks memory.
>>
>>     I tested it on GHC 7.4.1 and I don't see any space leak.
>>
>>     _______________________________________________
>>     Haskell-Cafe mailing list
>>     Haskell-Cafe <at> haskell.org <javascript:;>
>>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
Niklas Hambüchen | 19 Jul 04:12 2013

Re: Monad Transformer Space Leak

Sounds like a Real Good Thing to do :)

On Fri 19 Jul 2013 11:10:25 JST, Clark Gaebel wrote:
> No I haven't.
>
>   - Clark
>
> On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen <mail <at> nh2.me> wrote:
>> Did you file this as a bug?
>>
>> On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote:
>>> I'm on 7.6.2, and it does. Oh no.
>>>
>>>   - Clark
>>>
>>> On Tuesday, April 23, 2013, Tom Ellis wrote:
>>>
>>>     On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
>>>     > I tested it on GHC 6.12.1, which wasn't affected by the recent
>>>     "ackermann"
>>>     > bug, but still it leaks memory.
>>>
>>>     I tested it on GHC 7.4.1 and I don't see any space leak.
>>>
>>>     _______________________________________________
>>>     Haskell-Cafe mailing list
>>>     Haskell-Cafe <at> haskell.org <javascript:;>
>>>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>>
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe <at> haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Clark Gaebel | 19 Jul 04:20 2013
Picon
Picon

Re: Monad Transformer Space Leak

Then I will. Going to double check on 7.6.3, first.

Thanks for bringing this back to my attention. I forgot about it. :P

Regards,
  - Clark

On Thu, Jul 18, 2013 at 10:12 PM, Niklas Hambüchen <mail <at> nh2.me> wrote:
> Sounds like a Real Good Thing to do :)
>
> On Fri 19 Jul 2013 11:10:25 JST, Clark Gaebel wrote:
>> No I haven't.
>>
>>   - Clark
>>
>> On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen <mail <at> nh2.me> wrote:
>>> Did you file this as a bug?
>>>
>>> On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote:
>>>> I'm on 7.6.2, and it does. Oh no.
>>>>
>>>>   - Clark
>>>>
>>>> On Tuesday, April 23, 2013, Tom Ellis wrote:
>>>>
>>>>     On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
>>>>     > I tested it on GHC 6.12.1, which wasn't affected by the recent
>>>>     "ackermann"
>>>>     > bug, but still it leaks memory.
>>>>
>>>>     I tested it on GHC 7.4.1 and I don't see any space leak.
>>>>
>>>>     _______________________________________________
>>>>     Haskell-Cafe mailing list
>>>>     Haskell-Cafe <at> haskell.org <javascript:;>
>>>>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Haskell-Cafe mailing list
>>>> Haskell-Cafe <at> haskell.org
>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
Clark Gaebel | 19 Jul 05:04 2013
Picon
Picon

Re: Monad Transformer Space Leak

https://github.com/patperry/hs-monte-carlo/issues/9

On Thu, Jul 18, 2013 at 10:20 PM, Clark Gaebel <cgaebel <at> uwaterloo.ca> wrote:
> Then I will. Going to double check on 7.6.3, first.
>
> Thanks for bringing this back to my attention. I forgot about it. :P
>
> Regards,
>   - Clark
>
> On Thu, Jul 18, 2013 at 10:12 PM, Niklas Hambüchen <mail <at> nh2.me> wrote:
>> Sounds like a Real Good Thing to do :)
>>
>> On Fri 19 Jul 2013 11:10:25 JST, Clark Gaebel wrote:
>>> No I haven't.
>>>
>>>   - Clark
>>>
>>> On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen <mail <at> nh2.me> wrote:
>>>> Did you file this as a bug?
>>>>
>>>> On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote:
>>>>> I'm on 7.6.2, and it does. Oh no.
>>>>>
>>>>>   - Clark
>>>>>
>>>>> On Tuesday, April 23, 2013, Tom Ellis wrote:
>>>>>
>>>>>     On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote:
>>>>>     > I tested it on GHC 6.12.1, which wasn't affected by the recent
>>>>>     "ackermann"
>>>>>     > bug, but still it leaks memory.
>>>>>
>>>>>     I tested it on GHC 7.4.1 and I don't see any space leak.
>>>>>
>>>>>     _______________________________________________
>>>>>     Haskell-Cafe mailing list
>>>>>     Haskell-Cafe <at> haskell.org <javascript:;>
>>>>>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Haskell-Cafe mailing list
>>>>> Haskell-Cafe <at> haskell.org
>>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane