|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73845 pg_connect()/pg_close() memory leak
Submitted: 2016-12-30 17:50 UTC Modified: 2017-11-08 18:08 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: miloslav dot hula at gmail dot com Assigned:
Status: Duplicate Package: PostgreSQL related
PHP Version: 7.1.0 OS: Windows 10
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: miloslav dot hula at gmail dot com
New email:
PHP Version: OS:


 [2016-12-30 17:50 UTC] miloslav dot hula at gmail dot com
Memory remains occupied (24 bytes) after pg_connect()/pg_close() call. Calling gc_collect_cycles() does not help.

It kills our daemon script which connects/disconnects to database.

Isolated on Windows 10 but happens on Debian with PHP 5.6.

Test script:
for ($i = 0; $i < 500; $i++) {
	echo "$i: " . memory_get_usage()."\n";
	pg_close(pg_connect("host=localhost dbname=test"));


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-08 18:08 UTC]
-Status: Open +Status: Duplicate
 [2017-11-08 18:08 UTC]
Fixed in the scope of bug #75419.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 16:05:53 2022 UTC