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

pod parsing memory is never freed #4914

Open
p6rt opened this issue Dec 24, 2015 · 4 comments
Open

pod parsing memory is never freed #4914

p6rt opened this issue Dec 24, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 24, 2015

Migrated from rt.perl.org#127020 (status was 'open')

Searchable as RT127020$

@p6rt
Copy link
Author

p6rt commented Dec 24, 2015

From @LLFourn

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.

@p6rt
Copy link
Author

p6rt commented Nov 27, 2017

From @timo

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.

@p6rt
Copy link
Author

p6rt commented Nov 27, 2017

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

@p6rt
Copy link
Author

p6rt commented Nov 27, 2017

From @LLFourn

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​:

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.

@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