php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42846 Memory Leak in socket_recv and socket_read
Submitted: 2007-10-03 21:38 UTC Modified: 2007-11-21 10:00 UTC
From: brendoncrawford at gmail dot com Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 5.2.4 OS: OSX 10.4 / FreeBSD 6.2
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: brendoncrawford at gmail dot com
New email:
PHP Version: OS:

 

 [2007-10-03 21:38 UTC] brendoncrawford at gmail dot com
Description:
------------
Each call to socket_recv (or socket_read) leaks small amount of memory despite efforts to free up variables.

Reproduce code:
---------------
As far as I can tell, this is always reproduceable.

Please see:
http://pastebin.com/f342f6b99

Expected result:
----------------
Memory usage to decline back to original state before client connect.

Actual result:
--------------
If you simply connect and disconnect, you will see no problem. However, if you send data you will see memory usage slowly increasing.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-03 21:39 UTC] brendoncrawford at gmail dot com
Also reproduceable in FreeBSD 6.2
 [2007-11-21 10:00 UTC] jani@php.net
The same happens without any sockets, just reusing some variable. It's how the Zend MM works, not a real leak.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 27 07:03:34 2022 UTC