|P is for Practical|
Re^13: Memory leak questionby BrowserUk (Pope)
|on Oct 06, 2010 at 14:33 UTC||Need Help??|
I believe you are being bitten by regex engine leaks.
Here's what I discovered.
I thought that it was maybe the use of (so many) named captures, but I tried very hard to make them leak. A single regex with 175,000 named captures; matching /g against a string that contained 10,000 matches for them; in a (v.slow) loop. It grew very arge, but once it maxed out, it didn't leak at all.
Then I thought to try your monster regexes in a standalone script and run them directly on the sample date in a loop:
it doesn't leak at all. Not a jot.
So, it's not just the monster regexes, but also how they're are being used, or the results are being used that triggers the leak.
I'm kinda stuck for a direction in which to go now, but I hope that this will help you zero in on the cause. I'll keep looking.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.