perl memory issue

perl memory issue

am 24.07.2011 18:57:47 von Jim Green

Hello!

I have the following code which is giving me trouble, basically I was
tesing the Tibco::Rv module this was just a test program. what it does
is it creates a listener and calls a simple callback when the listener
sees a message. I ran this script but the memory use gets larger and
larger as time passes by. I understand as the callback is called more
and more times, perl reclaims the memory but never gives it back to
the
OS. So how could I modify the following code so that it runs without
consuming more memory?

Thanks!
Jim

--------------------------------

my ($service,$network,$daemon) = qw(10000 ;238.238.238.238 7500);
my ( $rv ) = Tibco::Rv->new(
service => $service,
network => $network,
daemon => $daemon
);

my ($listener) = $rv->createListener(
subject => '>',
callback => \&process_msg,
);
$rv->start;


sub process_msg {
my ( $msg ) = @_;
my $content = $msg->getFieldByIndex(0);
my $data = $content->{'data'};
print "$msg\n";
print $data,"\n";
return ;
} # ---------- end of subroutine process_msg ----------

--------------------------------


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: perl memory issue

am 25.07.2011 13:55:24 von Jim Green

pls ignore this post, it has nothing to do with perl itself. the
sender is basically overwhelming the receiver que and receiver
couldn't handle fast enough..

Thanks.


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/