Edit report at http://bugs.php.net/bug.php?id=53098&edit=1

 ID:                 53098
 Updated by:         fel...@php.net
 Reported by:        jayson dot cooke at ipeakmedia dot co dot uk
 Summary:            stream_socket_client Memory Leak when using
                     stream_context_create
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Sockets related
 Operating System:   Ubuntu
 PHP Version:        5.3SVN-2010-10-18 (snap)
 Block user comment: N

 New Comment:

No mem leak detected in Valgrind.



btw, memory_get_usage(1) returns the same value.


Previous Comments:
------------------------------------------------------------------------
[2010-10-18 17:15:21] jayson dot cooke at ipeakmedia dot co dot uk

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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53098&edit=1

Reply via email to