more useful options | |
PerlMonks |
Re: Memory use/leak with large number of (?{}) patterns in regexby dave_the_m (Monsignor) |
on Nov 24, 2019 at 15:10 UTC ( [id://11109148]=note: print w/replies, xml ) | Need Help?? |
Well, the lack of freeing is unremarkable. Running the regex is likely to malloc() and and finally free() lots of small chunks of memory. These will be reused if you run a similar regex again, but trying to then malloc() a single 1Gb string is unlikely to be able to make use of all those little blocks recently freed.
However, what *is* worrying is that memory usage goes quadratic on the number of code blocks in the pattern. I'll try to have a look at it sometime when I have the time. Dave.
In Section
Seekers of Perl Wisdom
|
|