ugexe / zef

Raku Module Management
Artistic License 2.0
207 stars 45 forks source link

memory leak #467

Closed coke closed 2 years ago

coke commented 2 years ago

Context

Using Zef::Client/Config in a loop leaks memory.

Expected Behavior

Memory usage should stabilize

Actual Behavior

Memory usage increases

Steps to Reproduce

% more mem.raku
    use Zef;
    use Zef::Client;
    use Zef::Config;

    my $chosen-config-file = %*ENV<ZEF_CONFIG_PATH> // Zef::Config::guess-path();
    my $config = Zef::Config::parse-file($chosen-config-file);

    my $zef = Zef::Client.new(:$config);

    my $module="App::Cal";
    loop {
            (state $c++).say

            my $candidates = $zef.find-candidates($module).head;
            my $deps = $zef.list-dependencies($candidates).map(*.identity).cache;
    }

resident memory up to 2G after 46 iterations here.

Your Environment

% raku -v
Welcome to Rakudo™ v2022.07.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.07.
% zef --version
v0.13.8
coke commented 2 years ago

Looks like this will be in 0.14.2