|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64859 memory leak in require/include when APC is enabled.
Submitted: 2013-05-16 12:02 UTC Modified: 2016-11-18 21:11 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: ptr dot wang at gmail dot com Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.3.25 OS: Linux/MacOSX
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:
Solve the problem:
37 - 37 = ?
Subscribe to this entry?

 [2013-05-16 12:02 UTC] ptr dot wang at gmail dot com
use the latest version of PHP (5.3.25) and latest version of APC (3.1.13),
just run this script and watch the memory usage of the php process
(please run with: php -d apc.enable_cli=1 )


while (true) {
    $file = 'file1.php';

if run with  -dapc.enable_cli=0, it does not leak memory.

Test script:

while (true) {
    $file = 'file1.php';

Expected result:
The memory usage should not grow.

Actual result:
The memory usage grows very quickly.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-05-16 22:23 UTC] ptr dot wang at gmail dot com
To stably re-produce the bug, we need create 2 files.
// file1.php, can be empty

// leak.php

while (true) {
    $file = 'file1.php';

then run: php -d apc.enable_cli=1 leak.php

hope this helps, thanks.
 [2016-11-18 21:11 UTC]
-Status: Open +Status: Wont fix
 [2016-11-18 21:11 UTC]
APC is no longer supported in favor of opcache that comes bundled with PHP, if you wish to use the user cache, then look at PECL/APCu.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 16:01:27 2023 UTC