On Sat, Jun 30, 2012 at 02:46:23PM -0500, Patrick R. Michaud wrote:
> On Thu, Jun 28, 2012 at 09:49:32PM +0100, Nicholas Clark wrote:
> > So, I attempted to build Rakudo on my Raspberry Pi, expecting it to go 
> > wrong.
> > It didn't quite pan out the way I expected.
> > [...]
> > It would be wonderful if Rakudo's memory usage would drop. I think that 
> > that's
> > going to be easier than finding a faster swap device.

To be fair, I suspect that NFS mounting a ramdisk and swapping to that might
well be faster, as I think the problem with the spinny thing as swap is the
seek time, not the bulk transfer rate, and the seek time on a ramdisk is zero.
But that would require more faffing than I'm really willing to do currently.

> We all agree that we'd really like to see Rakudo's memory usage
> drop, especially on the build steps for the larger files (like 
> Perl6/Actions.pm and CORE.settings).  At the moment it takes a
> lot of work and instrumentation (in all of Parrot, NQP, Rakudo)
> to find out what's consuming all of the memory.  It's also
> hard to know if things are being released/GC'd properly when
> they're no longer being used (it's fairly easy in Parrot to 
> end up with 'stray' references that cause large data structures 
> to hang around much longer than you might expect).

I've no idea if this is a small change, or a big change, but is it easy/viable/
useful to serialise the (in use) data structures between the various stages:

Stage parse: 163.188
Stage syntaxcheck: 0.000
Stage past: 0.000
Stage optimize: 22.881
Stage post: 55.730
Stage pir: 25.610

[timings from my laptop]

such that it's possible to run it as 6 (or maybe just 4 for the 4
significantly slow steps) ) processes chained together, or using temporary
output files.

If it's *easy*, it would be a win (I think) if the cost of memory usage of
unused structures is higher than the cost of startup plus the cost of
serialise/deserialise. And not a win if it's not.

> We'll keep chipping away at it, though.  Maybe others some
> some tools they can use to help us discover where the memory
> is going...?

That sentence missing a verb? :-) [Did you mean s/some/have/ ?]

Is there any Parrot or 6model equivalent of Devel::Size - ie a tool which
attempts to work out the memory usage of everything reachable from an input
object?

That seems like the most useful tool to start to attack this, as it lets one
ask "how big are the things I have?" and compare the actual answer with the
expected answer.

Nicholas Clark

Reply via email to