xslate / p5-Mouse

Lightweight class builder for Perl, as a subset of Moose
https://metacpan.org/release/Mouse
Other
46 stars 32 forks source link

Bad memory leak when mixing role with attributes #59

Open bbkr opened 8 years ago

bbkr commented 8 years ago

Following code causes big memory leak (on my machine 10MB per second). It happens only if role has some attributes. Weakening $a does not help.

package A;
use Mouse;

package B;
use Mouse::Role;
has "b" => ("is" => "ro",  "isa" => "Int");

package main;
while (1) {
    my  $a = A->new;
    B->meta->apply($a);
}
syohex commented 8 years ago

Sorry too late reply. I have confirmed that memory usage increases over time. However Test::Valgrind does not report such big memory leak.