|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-01-03 16:48 UTC] clarkwise at gmail dot com
Description:
------------
There appears to be a memory leak when retrieving non-empty arrays from user cache. In the provided test script, the same amount of memory should be used by the script no matter how many times the loop is iterated. That is the case when storing empty arrays, numbers, strings, and objects, but the amount of memory consumed scales in proportion to the number of iterations when a non-empty array is stored in 'foo'.
# iterations array() array(0) 'a string' 42.9 new stdClass()
10,000 0.305710 MB 0.611053 MB 0.305527 MB 0.305504 MB 0.309845 MB
100,000 0.305710 MB 3.357635 MB 0.305527 MB 0.305504 MB 0.309845 MB
1,000,000 0.305710 MB 30.823456 MB 0.305527 MB 0.305504 MB 0.309845 MB
10,000,000 0.305710 MB fatal error 0.305527 MB 0.305504 MB 0.309845 MB
(At 10,000,000 iterations, I get a fatal error because it hits my 128M memory limit at some point.)
I am using the latest stable Wincache version (1.1.0630.0), but it also occurs with the latest dev build I am able to try (1.2.614).
Test script:
---------------
wincache_ucache_set('foo', array(0));
for ($i = 0; $i < 1000000; ++$i) {
$foo = wincache_ucache_get('foo');
}
printf('Mem used: %f MB<br />', memory_get_peak_usage()/1024/1024);
Expected result:
----------------
Something of similar magnitude to:
"Mem used: 0.306000 MB"
Actual result:
--------------
"Mem used: 30.823456 MB"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 21:00:01 2025 UTC |
[Mopping up old bugs] Resolving this as "By Design", since this WinCache is doing exactly what it's supposed to do. Thx! --E.