|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ptr dot wang at gmail dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 10:01:30 2024 UTC