ZF-12005: getFillingPercentage miscalculation with the WinCache backend
Description
Hi,
the getFillingPercentage method of the WinCache backend of Zend_Cache don't calculate the filling percentage but the free memory percentage. Here's the patch :
--- a/vendors/Zend/Cache/Backend/WinCache.php
+++ b/vendors/Zend/Cache/Backend/WinCache.php
@@ -185,7 +185,7 @@ class Zend_Cache_Backend_WinCache extends Zend_Cache_Backend implements Zend_Cac
{
$mem = wincache_ucache_meminfo();
$memSize = $mem['memory_total'];
- $memUsed = $mem['memory_free'];
+ $memUsed = $mem['memory_total'] - $mem['memory_free'];
if ($memSize == 0) {
Zend_Cache::throwException('can\'t get WinCache memory size');
}
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2012-02-26T04:37:40.000+0000
Added code tag
Posted by Adam Lundrigan (adamlundrigan) on 2012-02-26T04:58:32.000+0000
Fixed in trunk r24651 Merged to release-1.11 in r24653
No ZF2 PR as Zend\Cache\Storage\Adapter\WinCache does not provide a filling percentage getter
Posted by Marc Bennewitz (private) (mabe) on 2012-03-10T09:59:55.000+0000
ZF2 provides a getCapacity method but it looks ok: