Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Perl memory Memory consumption

by orkysoft (Friar)
on Nov 24, 2001 at 04:20 UTC ( [id://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)

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://127197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found