Topic with 1932 replies (97 pages) - when viewing in "threaded view" PHP exits with something similar to:
Allowed memory size of 16 MB exhausted (tried to allocate ~500kB) in inc/functions.php line 118
Line 118 is on of str_replace in function parsepage($contents). I have checked strlen($contents) when PHP fails - it showed a page about 520 kB. I think this size of output is to big.
I have put memory_get_usage() in that function at the beginning and after every str_replace. Effects (in bytes):
Effects in normal page ($contents=100kb) - about 1 MB memory.
Solution? Make a pagination to threaded view? Or look closer why memory use grows so much before parsepage() (maybe use function unset() to free memory?)?
Apache: 1.3
MyBB: 1.1.7
PHP: 5, eaccelerator v0.9.5-rc1
MySQL: 4.1
Allowed memory size of 16 MB exhausted (tried to allocate ~500kB) in inc/functions.php line 118
Line 118 is on of str_replace in function parsepage($contents). I have checked strlen($contents) when PHP fails - it showed a page about 520 kB. I think this size of output is to big.
I have put memory_get_usage() in that function at the beginning and after every str_replace. Effects (in bytes):
15 782 568 (beginning of function)
16 304 704 (after '$contents = str_replace("<navigation>", buildnav(1), $contents);')
16 304 832
16 304 840
16 304 840
Effects in normal page ($contents=100kb) - about 1 MB memory.
Solution? Make a pagination to threaded view? Or look closer why memory use grows so much before parsepage() (maybe use function unset() to free memory?)?
Apache: 1.3
MyBB: 1.1.7
PHP: 5, eaccelerator v0.9.5-rc1
MySQL: 4.1
www.kozik.net.pl
- So... Maybe you shouldn't have hacked it.
- And why don't you try not breathing. Hurts, dunnit. (userfriendly.org)
- So... Maybe you shouldn't have hacked it.
- And why don't you try not breathing. Hurts, dunnit. (userfriendly.org)