Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Parallel::ForkManager, DBI using memory

by biosysadmin (Deacon)
on Nov 08, 2004 at 15:32 UTC ( #406081=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Parallel::ForkManager, DBI using memory
in thread Parallel::ForkManager, DBI using memory

Interesting. Another thing you might try is manually undef'ing your database handles at the end of your loop, like this:

foreach my $x (0..$#links) { $pm->start and next; my $dbh = DBI->connect("DBI:mysql:database=customers;host=loca +lhost;port=3306", "root", "") or die "Can't connect: ", $DBI::errstr; $dbh->{RaiseError} = 1; print "$links[$x]\n"; # do something (read, update, insert from db) $dbh->disconnect; undef($dbh); $pm->finish; }
Best of luck. :)


Comment on Re^3: Parallel::ForkManager, DBI using memory
Download Code
Replies are listed 'Best First'.
Re^4: Parallel::ForkManager, DBI using memory
by 2ge (Scribe) on Nov 08, 2004 at 18:30 UTC
    Hi biosys!

    thanks for next suggestion, I tryied that, unfortunately it doesn't help, also you have one little error in your posted script, undef($dbh) should be before $pm->finish. Any more ideas ? :)
    I really don't know how to solve this, I have around 15.000+ iterations, so I will always run out of memory by using this :(

    --
    Brano

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://406081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2015-07-29 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls