Re: DB_DataObject eats all my memory
| From: | Justin Patrin | Date: | Mon, 25 Oct 2004 20:02:54 +0000 |
| Subject: | Re: DB_DataObject eats all my memory | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15098@lists.php.net to get a copy of this message | ||
On Mon, 25 Oct 2004 11:17:07 +0200, Sven Lankes <sl@megabit.net> wrote:
> I have a script where I'm doing a lot of sql queries.
> This script eats memory until it's killed by the OOM-Killer
> at some point (using much more than 1GB).
>
> DB_DataObjects seems to be at fault.
>
> I have created a very simple testcase:
>
> > for ($i = 1; $i < 50000; $i++) {
maybe unset($test); here?
Perhaps DB_DO is storing the queries and results in its globals. Make
sur eyou turn off its history options.
> > $test = new DataObjects_Test;
> > $test->whereAdd("field2 like '4%'");
> > $test->find();
> > while ($test->fetch()) {
> > }
> > }
>
> The Test-Table consists of 100000 lines of random noise.
> If I run above code it starts out with a ps aux output
> of:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> sven 15451 41.0 1.4 94612 15308 pts/7 S+ 00:09 0:00 php ./read.php
>
> after a couple of hours it looks like this:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> sven 15451 73.4 7.4 155560 76160 pts/7 S+ 00:09 382:40 php ./read.php
>
> Rewriting my test-script using only the php postgres commands
> I can run it for hours w/o an increase in memory consumption.
>
> Any hints on how to solve this would be appreaciated.
>
> I'm using php 4.3.9, postgres 7.4.5 and DB_DataObject 1.7.2
>
--
paperCrane --Justin Patrin--