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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC