Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory panic due to string transcoding for every match #2772

Closed
p6rt opened this issue Jun 15, 2012 · 5 comments
Closed

Memory panic due to string transcoding for every match #2772

p6rt opened this issue Jun 15, 2012 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jun 15, 2012

Migrated from rt.perl.org#113666 (status was 'resolved')

Searchable as RT113666$

@p6rt
Copy link
Author

p6rt commented Jun 15, 2012

From gerd.r.devel@googlemail.com

The regex-dna benchmark script (
https://github.com/perl6/perl6-examples/blob/master/shootout/regex-dna.p6.pl
) eats all available memory on 32-bit systems.

The issue can be golfed to

  my $string = 'x' x 30000;
  my @​matches = $string.match(/./, :global);

Keeping around a transcoded version of the string for every match is
to blame according to analysis by jnthn and pmichaud​:

  http://irclog.perlgeek.de/perl6/2012-06-01#i_5667563

(occurs with Rakudo 2012.05-237-geef772d, but hasn't been fixed in master yet)

@p6rt
Copy link
Author

p6rt commented Jul 9, 2012

From @pmichaud

Now fixed in 9388218​:

  pmichaud@​kiwi​:~/p6/rakudo$ cat x
  my $str = 'x' x 30000;
  say $str.chars;

  say 'start';
  my @​matches = $str.match(/./, :global);
  say 'done';
  say +@​matches;

  pmichaud@​kiwi​:~/p6/rakudo$ ./perl6 x
  30000
  start
  done
  30000

I'm marking this ticket as 'testneeded' for now; but someone decides we
don't really need a test for this then I'm fine with closing the ticket
immediately.

Thanks,

Pm

@p6rt
Copy link
Author

p6rt commented Jul 9, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 22, 2014

From @coke

On Sun Jul 08 22​:08​:05 2012, pmichaud wrote​:

Now fixed in 9388218​:

pmichaud@​kiwi​:\~/p6/rakudo$ cat x
my $str = 'x' x 30000;
say $str\.chars;

say 'start';
my @​matches = $str\.match\(/\./, :global\);
say 'done';
say \+@​matches;

pmichaud@​kiwi​:\~/p6/rakudo$ \./perl6 x
30000
start
done
30000

I'm marking this ticket as 'testneeded' for now; but someone decides we
don't really need a test for this then I'm fine with closing the ticket
immediately.

Thanks,

Pm

I'm not sure roast is the place for testing this sort of thing. Perhaps something like perlbench once we notice a leak and write some code that exposes it?

Closing this ticket as fixed.
--
Will "Coke" Coleda

@p6rt p6rt closed this as completed Aug 21, 2014
@p6rt
Copy link
Author

p6rt commented Aug 21, 2014

@coke - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant