使用循环管道的大量内存使用

问题描述 投票:6回答:1

更新2:正如@Valle Lukas所指出的,看起来这是由于泄漏被解决。

更新1:

好的,我再次尝试这个,并有一个更简单的代码,以证明我遇到的问题:

my $channel=Channel.new;    #create a new channel
$channel.send(0);           #kickstart the circular pipeline
react {
    whenever $channel {
        say $_;
        $channel.send($_ + 1); #send back to same pipeline
        #sit back and watch the memory usage grow
    }
}

基本上我通过Channel创建一个单阶段管道,向它发送一条消息,然后设置react / whenever块来处理消息(添加1)并再次将其发送回同一个通道。管道一旦开始就永不停止。

内存使用量的增长(我达到大约600MB并且在大约10秒内攀升)不是由于消息缓冲,在提示中只有一条消息。

这只是一个错误,或者我如何解决频道的内存使用问题?

memory pipeline perl6
1个回答
4
投票

似乎是Jonathan Worthington承诺解决的

d5044de

25b486d

© www.soinside.com 2019 - 2024. All rights reserved.