php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58495 Memory usage grows for no reason
Submitted: 2009-01-08 11:10 UTC Modified: 2016-08-31 15:08 UTC
From: d dot shashkin at ultimate-guitar dot com Assigned: cmb (profile)
Status: Wont fix Package: APC (PECL)
PHP Version: 5 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 33 = ?
Subscribe to this entry?

 
 [2009-01-08 11:10 UTC] d dot shashkin at ultimate-guitar dot com
Description:
------------
Memory usage becames enourmous when I use apc cache.

Reproduce code:
---------------
Just run following code
<?

$a = $b = array();

$v = str_pad('',1000);

for($i = 0; $i < 10; $i++)
{
	$a[] = $v;
	$b[] = $v;
}

apc_store('key',$a);

?>
then run this code
<?

for($i=0;$i<100;$i++)
	$a = apc_fetch('key');

echo memory_get_usage(true);

?>
I've got memory usage of 10 485 760 bytes.

Then remove $b[] = $v; from the first part of code and run it again. Then run second part again. I've got memory usage 1 310 720 bytes.

Expected result:
----------------
I think that mmory usage in those examples should be the same.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-09 05:15 UTC] gopalv82 at yahoo dot com
Looking into it
 [2009-01-13 10:28 UTC] gopalv82 at yahoo dot com
Tested it on my dev box (linux-x86)

I get 524288 bytes for both cases, with 5.3-alpha (which IMHO is really weird).

Are you sure, you're using apc-3.1.2 for your testing?
 [2009-01-13 10:51 UTC] d dot shashkin at ultimate-guitar dot com
I'm using 3.0.19 (latest stable release).

Also I've tested it on php-5.2.8 on linux-x86 machine and got the same result as before.
 [2009-03-02 02:57 UTC] shire@php.net
I get the same results as Gopal for latest APC CVS and php-5.2.6 and php-5.3.0 CVS.  What are you using for your configure arguments when you build PHP and APC?  What does 'php -m' output?
 [2009-03-03 10:02 UTC] s dot shashkin at ultimate-guitar dot com
I use latest stable release (3.0.19). Is that what you mean by "latest APC CVS"?
 [2009-03-03 12:12 UTC] shire@php.net
Nope, I meant using our absolute latest code, not yet released.  You can do this following the instructions in the INSTALL file under "CVS Instructions": 

http://cvs.php.net/viewvc.cgi/pecl/apc/INSTALL?revision=3.65&view=co

(adjust your configure options as necessary of course).
 [2009-04-05 23:32 UTC] shire@php.net
Any updates on this with latest CVS?
 [2009-05-05 14:50 UTC] shire@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2009-05-06 02:39 UTC] d dot shashkin at ultimate-guitar dot com
I'm not able to intall new version of your library, but if you say that this bug can't be reproduced in newer version, then I think that this bug can be closed.
 [2009-05-08 15:21 UTC] shire@php.net
Do you just need the latest DLL builds to test?  If so I can leave this open till we do a new release, at which point you can tes
 [2009-05-11 03:06 UTC] d dot shashkin at ultimate-guitar dot com
Yes, I need dll's to test this on Windows or just lable "stable" to test it on linux (it's our production server). Yes, it would be nice if you'd keep this bug open until new stable release availible.
 [2016-08-31 15:08 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2016-08-31 15:08 UTC] cmb@php.net
According to <https://bugs.php.net/69618>, APC support has been
discontinued in favor of OPcache, APCu, the session upload
progress API and WinCache. Therefore this issue won't get fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC