I've come now this analysis why ConvertOldMarkup() crashes with certain
pages, and why not always. This is the only remaining showstopper for
the 1.3.11 release, but it's an ugly and persistent one.
Symptoms:
?action=loadfile&source=pgsrc&overwrite=1
crashes sometimes at the second encounter of the anchored regex loop at
the page "OldTextFormattingRules", esp. if the CreateToc plugin is used.
Similarily some more large old markup pages, but this is the only one
from the default pgsrc set.
But, loading the single page will work okay:
?action=loadfile&source=pgsrc/OldTextFormattingRules&overwrite=1
It crashes more often on linux, esp on sf.net php-4.1.2 than on newer
versions, esp Windows seems to be much more stable.
Apache2 and IIS crash more often than Apache1.
Possibly related symptom:
ADODB requires much more memory since the library upgrade with 1.3.10,
so that AllPages will fail > ~300 pages, without any given limit
parameter. Playing with the limit parameter will narrow the max. pageset
size.
But, PearDB will fail also.
Possible Reason:
Somehow the cached database use too much memory when simply iterating
over get_all_pages(). Exhausting the available php memory will crash
anchored PCRE matches, which is a (yet unknown) PHP bug.
What I have done so far:
I've tried to improve the sql calls, and to purge the cache from
unneeded data on such page iterations.
* _cached_html should be kept in the cache for the requested page. This
new policy is not yet enforced globally, just for some API calls.
* pagedata[%content'] should only be kept for pages which really need
the content. e.g. for the size column on pagelists the content can be
safely purged after having done the strlen(). Sorting on size makes it
problematic.
Nevertheless, despite these efforts the memory footprint increased
dramatically lately, though it really should have been decreased.
https://sourceforge.net/forum/message.php?msg_id=2654786
I'm investigating this further. Maybe someone heard about similar
problems elsewhere.
--
Reini Urban
http://phpwiki.sf.net/
|