Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re: Perl memory Memory consumption

by orkysoft (Friar)
on Nov 24, 2001 at 04:20 UTC ( #127197=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Perl memory Memory consumption
in thread Perl memory Memory consumption

Does the program grow if you leave out that process_msg subroutine call?

Also, use strict and my variables where possible, and don't make circular references like $a = \$b; $b = \$a;, or they'll never really get out of scope (they might go out of scope and be unreachable, but since they refer to eachother, they'll never go away)


Comment on Re: Re: Re: Perl memory Memory consumption
Download Code
Re: Re: Re: Re: Perl memory Memory consumption
by alfatux (Novice) on Nov 26, 2001 at 20:19 UTC
    Hi,

    No, with process_msg the program not gows.

    I've investigating more an I detect that the problem could be in the get_msg funtion that looks like:
    
    
    sub get_msg {
    
    
      my $self = shift;
    
    
      my ($param) = @_;
    
    
      my $consulta_stack = qq{
    
    
                             SELECT *
    
    
                             FROM out
    
    
                             WHERE app = $param
    
    
                             ORDER BY id DESC LIMIT 100;
    
    
                            };
    
    
      my $sth = $self->{dbh}->prepare($consulta_stack);
    
    
      $sth->execute();
    
    
      my $msgs = $sth->fetchall_hashref('id');
    
    
      $sth->finish;
    
    
      return $msgs;
    
    
    }
    
    
    
    I also observ that when there's no record in the resultset memory consumption is highter than when there's sontehing.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2015-07-07 06:50 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 (87 votes), past polls