|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-10-18 22:46 UTC] felipe@php.net
-Status: Open
+Status: Bogus
[2010-10-18 22:46 UTC] felipe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
Description: ------------ Using stream_socket_client on it's own works fine, but once using stream_context_create with it it creates a memory leak of 2kb each time which makes it unstable. Test script: --------------- <?php for ($i =0 ; $i <30 ; $i++) { $socket_options = array('socket' => array('bindto' => '127.0.0.1:0')); $socket_context = stream_context_create($socket_options); $fp=stream_socket_client('tcp://127.0.0.1:23', $error, $err, 5, STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT, $socket_context); unset($socket_context); unset($socket_options); unset ($fp); unset ($error); unset ($err);clea echo memory_get_usage()."\n"; } ?> Expected result: ---------------- 648504 650400 650400 654000 650400 650400 650400 650400 650400 650400 650400 650400 650400 650400 650400 650400 650400 .... Actual result: -------------- 648504 650400 652200 654000 655864 657664 659464 661264 663064 664864 666664 668464 670392 672192 673992 675792 677592 679392 681192 682992 684792 686592 688392 690192 691992 693792 695592 697392 699448 701248