Re: out of memory



On Fri, 29 Dec 2006 08:46:03 -0800, louis fridkis wrote:

Hi Louis

Thanks for your reply's. No, I'm not insulted. This is a quick-and-
dirty to generate some test data. But, I do appreciate the comments
since I am eager to improve.

Glad you're taking it the right way!

$rv = $cel_sth->bind_columns(\($elementresult_id, $element_id,
$quantification_id, $signal));

Why can't you use @rowvalues here?

while($cel_sth->fetch()){
@rowvalues = ($elementresult_id, $element_id, $quantification_id,
$signal); # # end # added & replaced #
my $printstring= "insert into $table_name values("; foreach my
$column (@rowvalues){ if (defined $column){ if($column =~

If you don't change the call to bind_columns(), why can't you use:
for my $column ($elementresult_id, $element_id, $quantification_id, $signal)
here? That saves copying the info into @rowvalues.

fetchrow_array(). I changed in the hopes that fetch() would work
better. The reason I think it tries to hold all the rows in memory
is because it works when the query in $sqlstring returns a small
number of rows, but fails with the "out of memory" error when it
returns a large number of rows.

That makes me think the problem really is you lack of RAM.
--
Cheers
Ron Savage, ron@xxxxxxxxxxxxx on 30/12/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company

.



Relevant Pages

  • Re: out of memory
    ... wouldn't it just be better to switch back ... On 12/29/06, Ron Savage wrote: ... That saves copying the info into @rowvalues. ... The reason I think it tries to hold all the rows in memory ...
    (perl.dbi.users)
  • Re: out of memory
    ... Assuming you're using mysql, take a look at the mysql_use_result attribute. ... my @rowvalues; ... I guess the problem is it tries to hold all the rows in memory. ... Lou Fridkis ...
    (perl.dbi.users)
  • Re: Decouple SQL queries from class in OOP design
    ... > Test data is all in memory - not stored in any file format. ... I assume the test data has to survive a system restart, ...
    (comp.object)
  • out of memory
    ... I am running out of memory when I try to select about 100K rows. ... my @rowvalues; ... foreach my $column { ... Lou Fridkis ...
    (perl.dbi.users)