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

: Hungry for RAM #4678

Closed
p6rt opened this issue Oct 25, 2015 · 3 comments
Closed

: Hungry for RAM #4678

p6rt opened this issue Oct 25, 2015 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 25, 2015

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

Searchable as RT126450$

@p6rt
Copy link
Author

p6rt commented Oct 25, 2015

From hughrsimpson@gmail.com

`perl6 -e 'my ($x,$y,$i) = (0,1,1); while ($i < 1000000) {$y += $x ; $x =
$y - $x ; $i += 1 } ; say $y;'` eats up 6GB of RAM on my system

$ perl6 -v
This is perl6 version 2015.09-433-g26617f9 built on MoarVM version
2015.09-79-gee9fc2b

@p6rt
Copy link
Author

p6rt commented Mar 25, 2017

From @MasterDuke17

The reason behind this behavior is that a bigint takes only very little space in the nursery, but it can hold on to a gigantic buffer. This was fixed by reducing the nursery limit by the size of the bigint buffer when they are created, triggering garbage collection earlier.

`/usr/bin/time ./install/bin/perl6-m -e 'my ($x,$y,$i) = (0,1,1); while ($i < 1000000) {$y += $x ; $x = $y - $x ; $i += 1 } ; say $y;'` now reports 124MB instead of 6GB.

Fixed in MoarVM commit MoarVM/MoarVM@63430ac
Brought into Rakudo in commit rakudo/rakudo@a123eb3

@p6rt
Copy link
Author

p6rt commented Mar 25, 2017

@MasterDuke17 - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Mar 25, 2017
@p6rt p6rt added the perf label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant