Bug #20495
closedfunction getByTag() in new caching framework runs out of memory
0%
Description
I got a:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 27672 bytes) in /srv/SVN/forge.typo3.org/Core/trunk/t3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php on line 107
after I tried to open the cache section of the adminpanel.
Steps to reproduce:
I have a fully cached news singleview page with a huge amount of cached versions. The table cache_pages is ~ 300MB big and it has ~ 5000 entries 99% of them on that very single view page.
If I now try to open the cache section of the admpanel it calls extGetNumberOfCachedPages(). This function calls getByTag() from the new caching framework. getByTag() tries to read the complete cache_pages table to an array which is passed back to extGetNumberOfCachedPages() which counts the array entries to display the number of cached page versions.
in older TYPO3 versions this worked flawlessly with 10000s of pages.
in TYPO3 4.2.6 function extGetNumberOfCachedPages looks like this:
function extGetNumberOfCachedPages($page_id) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pages', 'page_id='.intval($page_id));
list($num) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
return $num;
}
I suggest to use this function again .
(issue imported from #M11175)