php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46102 getenv() memory leak
Submitted: 2008-09-17 04:17 UTC Modified: 2008-10-31 15:55 UTC
From: jim at centerfuse dot net Assigned:
Status: Closed Package: Performance problem
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jim at centerfuse dot net
New email:
PHP Version: OS:

 

 [2008-09-17 04:17 UTC] jim at centerfuse dot net
Description:
------------
getenv() appears to cause a memory leak on Windows XP, 5.2.5. Could not reproduce on FreeBSD 4/PHP 5.0.5. It seems to only happen in the Apache module - the CLI exhibits the expected behavior.

Reproduce code:
---------------
echo memory_get_usage() . '<br /><br />';
		for ( $j = 0; $j < 100; $j++ ) {
			@getenv('SCRIPT_NAME');
			echo memory_get_usage() . '<br />';
		}
		


Expected result:
----------------
memory_get_usage() should report the same amount through all iterations

Actual result:
--------------
memory_get_usage() reports the same amount for the first 28 iterations, then begins to climb and continues to climb

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-24 21:04 UTC] ilia dot cheishvili at gmail dot com
This does not occur on the latest CVS checkout of 5.3.0.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC