Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Memory leaks

by saritto (Initiate)
on Nov 14, 2000 at 01:12 UTC ( [id://41434]=note: print w/replies, xml ) Need Help??


in reply to Memory leaks

Here is a snippet of the code that I am using:
$t = new Net::Telnet( Timeout => $conn_timeout, Errmode =>"return"); $firsttime = 0; while (1) { chomp( @target_list = <TARGET_FILE> ); close TARGET_FILE; foreach $target ( @target_list ) { ( $target_ip, $target_name, $target_port ) = ( split /\s+/, $t +arget ); my ($sec,$min,$hour,$mday,$mon,$year) = gmtime(time()); $mon += 1; $year += 1900; $time = ".$mon.$mday.$year.$hour:$min:$sec"; $filename = ($dumpfilename .$target_name).$time; $t->dump_log($filename); $ok = $t->open( Host => $target_ip, Port => $target_port); if($ok) { if(!($t->waitfor(String=>$wait_string, Timeout => $prompt_timeout))) { if (($var=( $actualtime = time) - $firsttime) > $al +arm_interval) { sendalarm( "agent process $target_name is no +t running on $target_port", "Agent-Process $target_name"); $alarm_flag=1; } # close tcp connection $t->close(); } else { # we have found a valid prompt $t->print("bye"); $t->close(); # remove dumpfile unlink($filename); } } else { if (($var = ( $actualtime = time) - $firsttime) > $ +alarm_interval) { sendalarm( "agent server $target_name +is not running on $target_port", "Agent-Server $target_name"); $alarm_flag=1; } unlink($filename); } }
thank you for all the help

Replies are listed 'Best First'.
Re: Re: Memory leaks
by Anonymous Monk on Feb 01, 2002 at 18:07 UTC
    Is there a Profiling Tool available that can identify where in the PERL program memory leaks occur. I have used tools like that with Java programs .. but do not know of any such tool for PERL applications. Please let me know.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-03-28 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found