Skip Menu |
Report information
Id: 127020
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: lloyd.fourn [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Date: Thu, 24 Dec 2015 11:14:09 +0000
Subject: pod parsing memory is never freed
Download (untitled) / with headers
text/plain 645b
use MONKEY-SEE-NO-EVAL;

sub MAIN($file) {
    {
        EVAL '=pod ' ~ "a" x 1_000_000;
    }
    note "sleeping -- check memory usage now! for me it gets to ~ 1GB;
    sleep 60;
}

Fairly self explanatory. This leads from perl6/docs htmlify.p6 to take > 1GB over the course of compiling perl6/docs.

2¢:
Where does this 1GB come from? 1 million 'a's depending on how it's stored is ~1mb. It is not the data in $=pod that is taking the space. I think it's the pod string concatenating code in Grammar.nqp, Actions.nqp and Pod.nqp and associated variables. But they should be freed after the EVALs compile time. But it looks like they are not.

Download (untitled) / with headers
text/plain 352b
a look at a profile makes me suspect the problem is having pod_string_character match a single character at a time, causing rather large numbers of match objects for comparatively short strings. It's probably worthwhile to steal a piece of implementation from "nibbling", aka parsing strings. a very short glance points do_nibbling out as interesting.
Subject: Re: [perl #127020] [PERF] pod parsing memory is never freed
To: perl6-bugs-followup [...] perl.org
Date: Mon, 27 Nov 2017 11:36:46 +0000
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Download (untitled) / with headers
text/plain 565b
Probably one of a number of things that would be easy if we made pod another language on the braid :)

On Mon, Nov 27, 2017 at 11:59 AM Timo Paulssen via RT <perl6-bugs-followup@perl.org> wrote:
Show quoted text
a look at a profile makes me suspect the problem is having pod_string_character match a single character at a time, causing rather large numbers of match objects for comparatively short strings.

It's probably worthwhile to steal a piece of implementation from "nibbling", aka parsing strings. a very short glance points do_nibbling out as interesting.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org