Bug #61371 [NEW]: stream_context_create() causes memory leaks on use streams_socket_create

From: Date: Tue, 13 Mar 2012 10:29:25 +0000
Subject: Bug #61371 [NEW]: stream_context_create() causes memory leaks on use streams_socket_create
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-168397@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      Irrelevant
Package:          Streams related
Bug Type:         Bug
Bug description:stream_context_create() causes memory leaks on use streams_socket_create

Description:
------------
stream_context_create() causes memory leaks on use width
stream_socket_client
Version PHP 5.3.6

Test script:
---------------
for($test=1;$test<=5;$test++) {
	echo 'memory: '.round(memory_get_usage()/1024, 0)."kb\n";
	for($i=0;$i<=100;$i++) {
		$context = stream_context_create(array());
		$stream = stream_socket_client('udp://0.0.0.0:80', $errno, $errstr, 10,
STREAM_CLIENT_CONNECT, $context);
		fclose($stream);
		unset($context);
		unset($stream);
	}
}

Expected result:
----------------
memory: 615kb
memory: 674kb
memory: 732kb
memory: 790kb
memory: 847kb



-- 
Edit bug report at https://bugs.php.net/bug.php?id=61371&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=61371&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=61371&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=61371&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=61371&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61371&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=61371&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=61371&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=61371&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=61371&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=61371&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=61371&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=61371&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=61371&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=61371&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=61371&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61371&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=61371&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=61371&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=61371&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=61371&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=61371&r=mysqlcfg



Thread (5 messages)

« previous php.bugs (#168397) next »