On 1/10/06, Elton Hughes <[EMAIL PROTECTED]> wrote:
> I have run into a problem I have not seen before. I need to select
> all of the rows in a table and I am getting the following error:
>
> # upd_wia_test.pl
> Today's date: 1/10/2006
> Running 'execute' .... done
> Running 'fetch' .... Out of memory!
> Issuing rollback() for database handle being DESTROY'd without
> explicit disconnect().
>
> I am running perl 5.8.7 on a Sun Ultra 60 with 2Gb of Ram, using
> Solaris 8. I am using DBI-1.50 and DBD-Informix-2005-02. Did I forget
> anything?
>
> It looks like that during fetchall_arrayref the system is running out
> of memory. A check of the table shows there are 35359 rows in that
> table. What parameters are in play here? Is there something in my
> onconfig that I can modify? Any thoughts?
>
Dear Elton,
The obvious primary factors are:
1. Size of each row of data.
2. If you've got blobs in the mix, you need to know how big they are;
DBD::Informix fetches them into memory.
3. Is this a 32-bit or a 64-bit version of Perl (ClientSDK - 2.90.UCx vs
2.90.FCx)?
4. On 32-bit systems, the number of shared libraries and their load
addresses can affect the total space available to the heap.
5. Are you using shared memory connections to IDS? (In sqlhosts, are you
using olipcshm, olipcstr or oltlitcp?)
There could be a memory consumption bug - I've not seen it reported before.
Can you give a simple reproduction - I'm using the same Perl and module
versions on the same o/s.
FWIW: I loaded 40960 rows into a table:
CREATE TABLE load_test(i SERIAL NOT NULL PRIMARY KEY, s VARCHAR(64) NOT
NULL);
and then used a script like this to select all 40K rows without problem:
#!/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect('dbi:Informix:stores','','',{RaiseError=>1});
my $sth = $dbh->prepare('select * from load_test');
$sth->execute;
my $a_ref = $sth->fetchall_arrayref({});
foreach my $h_ref (@$a_ref)
{
my($i) = $h_ref->{i};
my($s) = $h_ref->{s};
print "$i => $s\n";
}
$dbh->disconnect;
exit 0;
The actual rows probably averaged about 25 characters in the 's' column.
--
Jonathan Leffler <[EMAIL PROTECTED]> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."