Bug #74304 [Fbk->NoF]: Can't "upgrade" from mysql_* functions due to memory allocation problems

From: Date: Sun, 14 Jun 2020 04:22:04 +0000
Subject: Bug #74304 [Fbk->NoF]: Can't "upgrade" from mysql_* functions due to memory allocation problems
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227472@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74304&edit=1 ID: 74304 Updated by: php-bugs@lists.php.net Reported by: josh at endries dot org Summary: Can't "upgrade" from mysql_* functions due to memory allocation problems -Status: Feedback +Status: No Feedback Type: Bug Package: *Database Functions Operating System: FreeBSD PHP Version: 5.6.30 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-06-03 16:12:49] cmb@php.net Do you still experience this issue with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> ------------------------------------------------------------------------ [2017-03-27 17:29:16] nikic@php.net Which PHP version did you try this on? If on 5.6, I's suggest testing this on PHP 7 as well. I remember fixing a number of leaks, at least in PDO, relating either to error conditions or circular references. Maybe you hit a problem that has already been resolved. ------------------------------------------------------------------------ [2017-03-25 02:15:25] josh at endries dot org Ah, thanks for asking, I thought about something similar this morning but forgot. I just logged, copied and pasted the queries it runs into a single file and it worked, e.g.: foreach ($queries as $q) { $r = $db->query($q); /* ... */ } It's difficult to replicate the actual processing in one file, but looping over an array of the queries and running them, then counting $r->rows, works quickly without much memory usage. I'm not really sure what this might mean, if anything. It doesn't model the actual processing, which apparently makes a difference. I can look into doing that, but it will probably be tough. Maybe I can just squish all the files into one big one...there are dozens of classes, at least. I don't really understand how the app could somehow cause the memory issues within its processing when using PDO but not mysql_* when it just deals with the returned object. I mean I would think it would have the same memory issues regardless of the driver if the problem were the app's usage of the result objects. Hmmm. ------------------------------------------------------------------------ [2017-03-25 01:05:47] nikic@php.net Are you able to reproduce the increased memory usage in a self-contained script, or do you see this effect only as part of a larger application? ------------------------------------------------------------------------ [2017-03-25 00:50:47] josh at endries dot org Update: I changed all text columns used in the index queries to varchar but it made no difference. A number of these queries do SELECT * unfortunately. I tried calling GC after each "$result = null;" at the end of the PDO query() call but it made no difference, except taking way longer (I figured, what the heck, see what happens, maybe it's due to the number of queries). I'm using the binary package currently. I'll look into making a debug port build, not sure how to do that (the debug part, not the port part). If there are any other ideas on things to try please let me know. THanks ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=74304 -- Edit this bug report at https://bugs.php.net/bug.php?id=74304&edit=1

« previous php.bugs (#227472) next »