Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

w2ksp4.exe, WwwxxXdbf, procmail "FROM_MAILER" patch, Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF

Links

XODOX
Impressum

#1: perl memory issue

Posted on 2011-07-24 18:57:47 by 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/

Report this message

#2: Re: perl memory issue

Posted on 2011-07-25 13:55:24 by 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/

Report this message