develooper Front page | perl.dbi.users | Postings from December 2006

Re: out of memory

Thread Previous | Thread Next
From:
Ron Savage
Date:
December 29, 2006 13:59
Subject:
Re: out of memory
Message ID:
2006123085318.046645@ron
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@savage.net.au on 30/12/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About